繁体   English   中英

接受不受信任的SSL证书FireFox Selenium RemoteWebDriver

[英]Accepting Untrusted SSL Cert FireFox Selenium RemoteWebDriver

我无法接受不受信任的SSL证书(目前,我仅尝试使用Firefox)

我正在使用的代码是:

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);

需要注意的是,我也尝试了我已经注释掉的内容,但似乎没有任何效果。

启动远程Webdriver时,负载平衡器将重定向到URL,该URL将不信任证书重定向到SSL地址。 我需要自动接受这些不受信任的证书。

不受信任的img

如果图片无法加载:

https://apps.education.ucsb.edu/wiki/文件:Firefox_connection_is_untrusted_i_understand_the_risks_add_exception.png

我在跑:

  • selenium-server-standalone-2.32.0.jar

  • Firefox版本:24.0

在此先感谢您的协助!

您可以在Firefox中安装安全证书,然后将其添加到受信任的证书中。 您可以在selenium独立server.jar中找到该证书。 解压缩.jar并将所有内容转储到文件夹中。 进入该文件夹,然后进入sslSupport,应该有一个名为cybervillainsCA的安全证书。 您可以将此证书添加到浏览器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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