1 // -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
2 // This Source Code Form is subject to the terms of the Mozilla Public
3 // License, v. 2.0. If a copy of the MPL was not distributed with this
4 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 // In which we connect to a server that staples an OCSP response for a
8 // certificate signed by an intermediate that has an OCSP AIA to ensure
9 // that an OCSP request is not made for the intermediate.
11 var gOCSPRequestCount = 0;
13 function add_ocsp_test(aHost, aExpectedResult) {
14 add_connection_test(aHost, aExpectedResult, function () {
22 Services.prefs.setBoolPref("security.ssl.enable_ocsp_stapling", true);
24 let ocspResponder = new HttpServer();
25 ocspResponder.registerPrefixHandler("/", function (request, response) {
27 response.setStatusLine(request.httpVersion, 500, "Internal Server Error");
28 let body = "Refusing to return a response";
29 response.bodyOutputStream.write(body, body.length);
31 ocspResponder.start(8888);
33 add_tls_server_setup("OCSPStaplingServer", "ocsp_certs");
36 "ocsp-stapling-with-intermediate.example.com",
40 add_test(function () {
41 ocspResponder.stop(run_next_test);
43 add_test(function () {
44 equal(gOCSPRequestCount, 0, "No OCSP requests should have been made");