Bug 1940967 - Vendor glean_parser v16.2.0 r=TravisLong,mach-reviewers,ahal
[gecko.git] / security / manager / ssl / tests / unit / test_allow_all_cert_errors.js
blob6bcd71aaf3ddfc381d02dae79273363bc847116e
1 /* -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* Any copyright is dedicated to the Public Domain.
4  * http://creativecommons.org/publicdomain/zero/1.0/ */
5 "use strict";
7 function run_test() {
8   do_get_profile();
9   let certOverrideService = Cc[
10     "@mozilla.org/security/certoverride;1"
11   ].getService(Ci.nsICertOverrideService);
12   certOverrideService.setDisableAllSecurityChecksAndLetAttackersInterceptMyData(
13     true
14   );
16   add_tls_server_setup("BadCertAndPinningServer", "bad_certs");
17   add_connection_test("expired.example.com", PRErrorCodeSuccess);
18   add_test(function () {
19     certOverrideService.setDisableAllSecurityChecksAndLetAttackersInterceptMyData(
20       false
21     );
22     run_next_test();
23   });
24   run_next_test();