Selenium: Selenium 3.3.1 and Firefox 52 - SSL Certificate Issue

Created on 12 Apr 2017  路  8Comments  路  Source: SeleniumHQ/selenium

Hello All,

I am unable to open an https site even after handling the certificate issue. I have manually created a firefox profile called "Selenium" and have written the below code. Everytime firefox is displaying "Your connection is not secure".

System.setProperty("webdriver.gecko.driver", "C:/Users/rajarss/Desktop/Selenium_Packages/Geckodriver/geckodriver.exe");
ProfilesIni prof = new ProfilesIni();               
FirefoxProfile ffProfile= prof.getProfile ("Selenium");
ffProfile.setAcceptUntrustedCertificates(true);
ffProfile.setAssumeUntrustedCertificateIssuer(true);
WebDriver driver =  new FirefoxDriver(ffProfile);
        driver.get("the https site here");

I have even tried encountering this problem differently by writing the below code:

DesiredCapabilities capabilities = DesiredCapabilities.firefox();
FirefoxProfile fp = new FirefoxProfile();
fp.setAcceptUntrustedCertificates(true);
fp.setAssumeUntrustedCertificateIssuer(true);
capabilities.setCapability(FirefoxDriver.PROFILE, fp);
//capabilities.setCapability("acceptInsecureCerts", true);
WebDriver driver = new FirefoxDriver(fp);
driver.get("the https site here");

Everytime I am trying to open the https website, firefox wont let me get through. Can anyone please help. I am stuck badly here. :(
Thanks in advance.

Regards,
Raj

C-java D-marionette

Most helpful comment

I used a variation of @bradhasha's solution. Here is a snippet that should work.

FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setAcceptUntrustedCertificates(true);
firefoxProfile.setAssumeUntrustedCertificateIssuer(true);
DesiredCapabilities dc = new FirefoxOptions().setProfile(firefoxProfile).addTo(DesiredCapabilities.firefox());
driver = new FirefoxDriver(dc);

@AutomatedTester This issue still applies to Selenium 3.4, GeckDriver 0.18 and Firefox 54.0.1. In my case, I'm running everything on Fedora Workstation 26. One of the things I noticed while stepping through the code, was that despite setting the two properties on the FirefoxProfile object, the desired capabilities that would be transmitted to the browser would be the defaults. The altered profile object was seemingly ignored at that point. By explicitly setting the desired capabilities, this no longer occurs.

All 8 comments

Hi!
I experienced the same errors unfortunately...
I updated a selenium library (3.3) firefoxDriver (gecko 0.15) and IEDriver (3.3) and SSL Certificates not working anymore in FF and IE that I used for several months. (Chrome still works fine.)
Have some solutions for this by somebody or I should to downgrade my libaries?

Regards,
S.M.

If your Firefox Profile directory is local, this seems to be working for me.

I am specifying the profile with FirefoxOptions.

DesiredCapabilities dc = new FirefoxOptions().setProfile(new FirefoxProfile(new File("path-to-root-dir-of-browser-profile"))).addTo(DesiredCapabilities.firefox());
WebDriver dr = new FirefoxDriver(dc);

I am using Selenium Java v3.3.0.

Can everyone try with Selenium 3.4, GeckoDriver 0.16+ and Firefox 53. This should have been fixed in 52, it was working in at least the python bindings. It would be good to see what people are now seeing.

No, it is not working with Selenium 3.4, GeckoDriver 0.16+ and Firefox 52. Can we get help please?

I m using Selenium 3.4 with GeckoDriver 0.16 and Firefox 53, with this setting also i m getting the same issue can anyone please help i got stuck here badly??
I m facing problem with domain sites with https connection
if i manually launch the same URL works fine but with selenium script it gives me insecure connection error

I used a variation of @bradhasha's solution. Here is a snippet that should work.

FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setAcceptUntrustedCertificates(true);
firefoxProfile.setAssumeUntrustedCertificateIssuer(true);
DesiredCapabilities dc = new FirefoxOptions().setProfile(firefoxProfile).addTo(DesiredCapabilities.firefox());
driver = new FirefoxDriver(dc);

@AutomatedTester This issue still applies to Selenium 3.4, GeckDriver 0.18 and Firefox 54.0.1. In my case, I'm running everything on Fedora Workstation 26. One of the things I noticed while stepping through the code, was that despite setting the two properties on the FirefoxProfile object, the desired capabilities that would be transmitted to the browser would be the defaults. The altered profile object was seemingly ignored at that point. By explicitly setting the desired capabilities, this no longer occurs.

@ArticPheenix. I have verified your code. It works with Selenium 3.4, GeckDriver 0.18 and Firefox 54.0.1
Thanks

Fixed in geckodriver 0.18
@ArcticPheenix Yes, mentioned preferences are valid for legacy Firefox driver only. Please use capabilities.

Was this page helpful?
0 / 5 - 0 ratings