Selenium SSL 握手问题
在尝试访问测试门户时,我在使用 selenium.start("captureNetworkTraffic=true");
模式时遇到以下问题。
HTTP ERROR: 400
Could not proxy https://myurl.com
java.lang.RuntimeException: Couldn't establish SSL handshake. Try using trustAllSSLCertificates.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
RequestURI=/auth/login
请注意,这种情况仅发生在 captureNetworkTrafficMode 中。一个简单的 selenium.start();
完全可以正常工作。
这是访问代码 -
RemoteControlConfiguration settings = new RemoteControlConfiguration();
File f = new File("C:\\selenium-profile");
BrowserConfigurationOptions bco = new BrowserConfigurationOptions();
bco.setCommandLineFlags("-trustAllSSLCertificates");
bco.setCommandLineFlags("-disable-web-security");
bco.setCommandLineFlags("-avoidProxy");
settings.setFirefoxProfileTemplate(f);
settings.setReuseBrowserSessions(true);
settings.setSingleWindow(true);
SeleniumServer seleniumserver=new SeleniumServer(settings);
seleniumserver.boot();
seleniumserver.start();
selenium = new DefaultSelenium("localhost",4444,"*chrome","http://myurl.com") {
public void open(String url) {
commandProcessor.doCommand("open", new String[] {url,"true"});
}
};
selenium.start("captureNetworkTraffic=true");
selenium.open("/");
这个问题似乎已经被打死了,但我仍然没有找到令人信服的解决方案......大多数人建议创建自定义 FF 配置文件,但这不起作用。
While attempting to access a test portal, I'm encountering the following problem while using the selenium.start("captureNetworkTraffic=true");
mode.
HTTP ERROR: 400
Could not proxy https://myurl.com
java.lang.RuntimeException: Couldn't establish SSL handshake. Try using trustAllSSLCertificates.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
RequestURI=/auth/login
Note that this happens only in the captureNetworkTrafficMode. A simple selenium.start();
works with no problem at all.
Here's the access code -
RemoteControlConfiguration settings = new RemoteControlConfiguration();
File f = new File("C:\\selenium-profile");
BrowserConfigurationOptions bco = new BrowserConfigurationOptions();
bco.setCommandLineFlags("-trustAllSSLCertificates");
bco.setCommandLineFlags("-disable-web-security");
bco.setCommandLineFlags("-avoidProxy");
settings.setFirefoxProfileTemplate(f);
settings.setReuseBrowserSessions(true);
settings.setSingleWindow(true);
SeleniumServer seleniumserver=new SeleniumServer(settings);
seleniumserver.boot();
seleniumserver.start();
selenium = new DefaultSelenium("localhost",4444,"*chrome","http://myurl.com") {
public void open(String url) {
commandProcessor.doCommand("open", new String[] {url,"true"});
}
};
selenium.start("captureNetworkTraffic=true");
selenium.open("/");
This problem seems to have been beaten to death, but I still haven't come across a convincing solution...Most recommend the creation of a custom FF profile, but this doesn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它归结为一个额外的浏览器设置来信任所有 SSL 证书:
It boiled down to an additional browser setting to trust all SSL certificates: