tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_allow_all_cert_errors.js (794B)


      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";
      6 
      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  );
     15 
     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();
     25 }