selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Selenium 3.3.1 and Firefox 52 - SSL Certificate Issue

Open rajarshisaha opened this issue 9 years ago • 8 comments

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

rajarshisaha avatar Apr 12 '17 16:04 rajarshisaha

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.

Mikeux avatar Apr 13 '17 10:04 Mikeux

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.

bradhasha avatar Apr 21 '17 15:04 bradhasha

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.

AutomatedTester avatar Apr 26 '17 10:04 AutomatedTester

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

tsheva avatar May 11 '17 06:05 tsheva

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

Dilip-Vaze avatar Jun 15 '17 11:06 Dilip-Vaze

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.

ArcticPheenix avatar Aug 04 '17 20:08 ArcticPheenix

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

bmohapat avatar Aug 21 '17 17:08 bmohapat

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

barancev avatar Sep 04 '17 12:09 barancev