[英]Accepting Untrusted SSL Cert FireFox Selenium RemoteWebDriver
I am unable to accept untrusted SSL certs (at this point i'm only trying with firefox) 我无法接受不受信任的SSL证书(目前,我仅尝试使用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. 启动远程Webdriver时,负载平衡器将重定向到URL,该URL将不信任证书重定向到SSL地址。 I need to auto accept these untrusted certs.
我需要自动接受这些不受信任的证书。
incase the image doesn't load: 如果图片无法加载:
https://apps.education.ucsb.edu/wiki/File:Firefox_connection_is_untrusted_i_understand_the_risks_add_exception.png https://apps.education.ucsb.edu/wiki/文件:Firefox_connection_is_untrusted_i_understand_the_risks_add_exception.png
I'm running: 我在跑:
selenium-server-standalone-2.32.0.jar selenium-server-standalone-2.32.0.jar
Firefox Version: 24.0 Firefox版本:24.0
Thanks in advance for the assistance! 在此先感谢您的协助!
You can install the security certificate in your firefox and add it to your trusted certificates. 您可以在Firefox中安装安全证书,然后将其添加到受信任的证书中。 You can find the certificate in the selenium standalone server.jar.
您可以在selenium独立server.jar中找到该证书。 Unzip the .jar and dump all the contents into a folder.
解压缩.jar并将所有内容转储到文件夹中。 Go into the folder, and go into sslSupport, there should be a security certificate called cybervillainsCA.
进入该文件夹,然后进入sslSupport,应该有一个名为cybervillainsCA的安全证书。 You can add this certificate to your browser.
您可以将此证书添加到浏览器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.