简体   繁体   English

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

[英]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. 我需要自动接受这些不受信任的证书。

不受信任的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 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.

相关问题 硒RemoteWebDriver Firefox产生NullPointerException - selenium RemoteWebDriver firefox producing NullPointerException 边缘驱动程序不受信任的证书功能(硒) - Edge driver untrusted cert capability (Selenium) 允许Opera浏览器使用不受信任的SSL证书。 硒测试(Java) - Allowing Untrusted SSL Certificates with Opera browser. Selenium testing (Java) 使用WebDriver接受不受信任的SSL证书,该窗口用于在单击菜单选项时打开的窗口 - Accepting untrusted SSL certificate using webdriver for a window that opens up on clicking a menu option 从Selenium RemoteWebDriver与Selenium Docker Firefox容器连接时,如何解决“拒绝连接”错误? - How to fix “Connection Refused” error while connecting with Selenium Docker Firefox container from Selenium RemoteWebDriver? 将Selenium 2 RemoteWebDriver与ChromeDriver结合使用 - Using Selenium 2 RemoteWebDriver with ChromeDriver Selenium RemoteWebDriver FileDetector Java - Selenium RemoteWebDriver FileDetector Java 确定FirefoxProfile是否接受不受信任的证书 - Determine if a FirefoxProfile is accepting untrusted certificates or not 使用ThreadLocal的FluentWait硒<RemoteWebDriver> - FluentWait selenium using ThreadLocal<RemoteWebDriver> Selenium RemoteWebDriver中的批处理/原子操作? - Batch/atomic operations in Selenium RemoteWebDriver?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM