简体   繁体   中英

Accepting Untrusted SSL Cert FireFox Selenium RemoteWebDriver

I am unable to accept untrusted SSL certs (at this point i'm only trying with firefox)

The code i'm using is:

FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
//profile.setAssumeUntrustedCertificateIssuer(false);
cap = DesiredCapabilities.firefox();
cap.setCapability(FirefoxDriver.PROFILE, profile);
//cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
cap.setCapability("takesScreenshot", true);
driver = new RemoteWebDriver(new URL(localURL),cap);

To Note, i've tried what i've commented out as well, and nothing seemingly works.

When the remote webdriver launches, the url i go to gets redirected by a load balancer to an SSL address, where the cert is untrusted. I need to auto accept these untrusted certs.

不受信任的img

incase the image doesn't load:

https://apps.education.ucsb.edu/wiki/File:Firefox_connection_is_untrusted_i_understand_the_risks_add_exception.png

I'm running:

  • selenium-server-standalone-2.32.0.jar

  • Firefox Version: 24.0

Thanks in advance for the assistance!

You can install the security certificate in your firefox and add it to your trusted certificates. You can find the certificate in the selenium standalone server.jar. Unzip the .jar and dump all the contents into a folder. Go into the folder, and go into sslSupport, there should be a security certificate called cybervillainsCA. You can add this certificate to your browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM