Roman A. Taycher
Roman A. Taycher

Reputation: 19505

How do I force Firefox Selenium Webdriver(Python) to accept any SSL certificates

I'm trying to fix testing for an internal app and I don't care about security at the moment (I just want it to work).

It's giving me SSL warnings which breaks the testing. Specifically Your connection is not secure/ SEC_ERROR_UNKOWN_ISSUER.

I've tried both setting capabilities['acceptSslCerts'] = True and

profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True

and neither works. The capabilities listed by the driver after constructing it has acceptSslCerts as false.

Note I'm using Python and Firefox 47.

Also I switched to using the new marionette Firefox Webdriver because the regular one was crashing on startup.

Upvotes: 4

Views: 7307

Answers (2)

Rémi Debette
Rémi Debette

Reputation: 116

The Firefox Self-signed certificate bug has now been fixed: accept ssl cert with marionette firefox webdrive python splinter

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

caps = DesiredCapabilities.FIREFOX.copy()
caps['acceptInsecureCerts'] = True
ff_binary = FirefoxBinary("path to the Nightly binary")

driver = webdriver.Firefox(firefox_binary=ff_binary, capabilities=caps)
driver.get("https://expired.badssl.com")

Upvotes: 3

kwoxer
kwoxer

Reputation: 3833

The issue is the Firefox Version 47 (see https://github.com/SeleniumHQ/selenium/issues/2110).

So you are good to go to wait for a fix of Firefox/Selenium or you downgrade to Firefox 46.

Upvotes: 2

Related Questions