2

I am working with BrowserMob-Proxy and Selenium. Loading pretty much any URL results in a Your connection is not secure, Error code:SEC_ERROR_UNKNOWN_ISSUER error in the browser. However, when I import the certificate given by BMP (via Firefox->Options->Advanced->Certificates->Import), everything works smoothly.

My question is how to do this programmatically. I have already tried

profile.accept_untrusted_certs = True

but that doesn't seem to have any affect at all. Any way to to this?

James Lemieux
  • 720
  • 1
  • 9
  • 26

1 Answers1

3

Create a new firefox profile "sslProfile". See firefox help for your OS.

In your selenium code:

ProfilesIni prof = new ProfilesIni()                
FirefoxProfile foxProfile= prof.getProfile ("sslProfile")

foxProfile.setAcceptUntrustedCertificates(true) 
foxProfile.setAssumeUntrustedCertificateIssuer(false)

WebDriver driver = new FirefoxDriver (foxProfile) 
MikeJRamsey56
  • 2,779
  • 1
  • 20
  • 34