Esempio n. 1
0
 def is_mitmproxy_cert_installed(self, browser_install):
     """Verify mitmxproy CA cert was added to Firefox"""
     from mozharness.mozilla.firefox.autoconfig import read_autoconfig_file
     try:
         # read autoconfig file, confirm mitmproxy cert is in there
         certificate = self._read_certificate(DEFAULT_CERT_PATH)
         contents = read_autoconfig_file(browser_install)
         if (MITMPROXY_ON_SETTINGS % {'cert': certificate}) in contents:
             LOG.info("Verified mitmproxy CA certificate is installed in Firefox")
         else:
             LOG.info("Firefox autoconfig file contents:")
             LOG.info(contents)
             return False
     except Exception:
         LOG.info("Failed to read Firefox autoconfig file, when verifying CA cert install")
         return False
     return True
Esempio n. 2
0
def is_mitmproxy_cert_installed(browser_install):
    """Verify mitmxproy CA cert was added to Firefox"""
    from mozharness.mozilla.firefox.autoconfig import read_autoconfig_file
    try:
        # read autoconfig file, confirm mitmproxy cert is in there
        certificate = _read_certificate(DEFAULT_CERT_PATH)
        contents = read_autoconfig_file(browser_install)
        if (MITMPROXY_SETTINGS % {'cert': certificate}) in contents:
            LOG.info("Verified mitmproxy CA certificate is installed in Firefox")
        else:
            LOG.info("Firefox autoconfig file contents:")
            LOG.info(contents)
            return False
    except Exception:
        LOG.info("Failed to read Firefox autoconfig file, when verifying CA certificate install")
        return False
    return True