2
votes

I'm updating the version of Firefox we use for our in house Selenium tests. As part of this I know I need to use the GeckoDriver, in a similar way that we need to use the ChromeDriver for Chrome. It seems to be all plumbed in but the Software Under Test uses a self signed ssl cert, which will give you the "untrusted" cert warning before proceeding. In order to work around this, I have the following code:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
capabilities = DesiredCapabilities.FIREFOX
capabilities['acceptSslCerts'] = True
firefox_log = "<path to firefox log>"

DRIVER = webdriver.Firefox(firefox_profile=profile, executable_path=<path to gecko driver exe>, capabilities=capabilities, log_path=firefox_log)

However, when the tests run, it does run/open Firefox, but it instantly errors with he following:

WebDriverException: Message: Reached error page: about:certerror?e=nssBadCert&u=https%3A//10.10.10.10/&c=UTF-8&f=regular&d=10.10.10.10%20uses%20an%20invalid%20security%20certificate.%0A%0AThe%20certificate%20is%20not%20trusted%20because%20it%20is%20self-signed.%0AThe%20certificate%20is%20only%20valid%20for%20%3Ca%20id%3D%22cert_domain_link%22%20title%3D%22amnesiac%22%3Eamnesiac%3C/a%3E%0A%0AError%20code%3A%20%3Ca%20id%3D%22errorCode%22%20title%3D%22SEC_ERROR_UNKNOWN_ISSUER%22%3ESEC_ERROR_UNKNOWN_ISSUER%3C/a%3E%0A

I know that there was a bug in this area but I was under the impression it was fixed. Am I missing something?

Version Info:

  • Firefox Version: 51.0.1
  • GeckoDriver Version: 0.14.0
  • Selenium Version: 3.0.2
1
I have also tried using "acceptInsecureCerts" instead of "acceptSslCerts" and I get the same outcome.David Mankellow

1 Answers

0
votes

I to am facing this issue, trying to get this capability to work for me in .NET. But I did notice you are using Firefox 51.0.1. While the bug fix for this has been live since (I beileve) GeckoDriver 0.11.0 it was dependent on the fix of a bug in Firefox which according to the original bug it was VERIFIED FIXED in Firefox 52. So I would try updating Firefox since 52 became the stable release 3/7/2016. Hope that helps.