5

I got stuck in handling UntrustedSSLcertificates using web driver in Java.

I created firefox profile like:

FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(false);

I created firefox profile, added overridden certificate.

This is not handling SSL certificates.

Is there any other way to handle UntrustedSSLcertificates?

kamaci
  • 72,915
  • 69
  • 228
  • 366
chakri
  • 65
  • 1
  • 2
  • 4

2 Answers2

1

//Firefox example with URL www.google.com

FirefoxProfile profile=new FirefoxProfile();

profile.setAssumeUntrustedCertificateIssuer(false);

driver=new FireforDriver(profile);

driver.get("https://google.com");
-1

Eventually I found solution for Untrusted SSLCertificates:

ProfilesIni allProfiles = new ProfilesIni();
System.setProperty("webdriver.firefox.profile","your custom firefox profile name");
String browserProfile = stem.getProperty("webdriver.firefox.profile");
FirefoxProfile profile = allProfiles.getProfile(browserProfile); 
profile.setAcceptUntrustedCertificates (true); 
webdriver = new FirefoxDriver(profile); 
kamaci
  • 72,915
  • 69
  • 228
  • 366
chakri
  • 65
  • 1
  • 2
  • 4