Skip to content Skip to sidebar Skip to footer

Python Webdriver - Firefox Profiles - Error Code: Sec_error_unknown_issuer -

Read through all over the internet but still can't resolve the following error while trying to run test script on my test environment 'The certificate is not trusted because the

Solution 1:

I search around and couldn't find an working answer either. Interestingly, I found that with updating some already discussed settings, it works in iPython console but not in terminal, for whatever reason. So I went to compare all modified configurations in about:config. There are three preference items that differs. Updating them actually does the magic for me in Mac OS and in Ubuntu. Here is the code. Note you must updating them by changing the default preferences. Code tested in Firefox 63.0.3 with geckodriver version 0.23.0.

from selenium import webdriver

profile = webdriver.FirefoxProfile()
profile.DEFAULT_PREFERENCES['frozen']['marionette.contentListener'] = True
profile.DEFAULT_PREFERENCES['frozen']['network.stricttransportsecurity.preloadlist'] = False
profile.DEFAULT_PREFERENCES['frozen']['security.cert_pinning.enforcement_level'] = 0
profile.set_preference('webdriver_assume_untrusted_issuer', False)
profile.set_preference("browser.download.folderList", 2)
profile.set_preference("browser.download.manager.showWhenStarting", False)
profile.set_preference("browser.download.dir", temp_folder)
profile.set_preference("browser.helperApps.neverAsk.saveToDisk",
                       "text/plain, image/png")
driver = webdriver.Firefox(firefox_profile=profile)

Solution 2:

This code block works for me :

from selenium import webdriver

profile = webdriver.FirefoxProfile()
profile.set_preference("security.enterprise_roots.enabled", True)

driver = webdriver.Firefox(firefox_profile=profile)

Post a Comment for "Python Webdriver - Firefox Profiles - Error Code: Sec_error_unknown_issuer -"