使用 WebDriver 处理 UntrustedSSL 证书 [英] Handling UntrustedSSLcertificates using WebDriver

查看:26
本文介绍了使用 WebDriver 处理 UntrustedSSL 证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Java 中的 Web 驱动程序处理 UntrustedSSLcertificates 时遇到了困难.

I got stuck in handling UntrustedSSLcertificates using web driver in Java.

我创建了 Firefox 配置文件,例如:

I created firefox profile like:

FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(false);

我创建了 firefox 配置文件,添加了被覆盖的证书.

I created firefox profile, added overridden certificate.

这不处理 SSL 证书.

This is not handling SSL certificates.

还有其他方法可以处理 UntrustedSSL 证书吗?

Is there any other way to handle UntrustedSSLcertificates?

推荐答案

最终我找到了 Untrusted SSLCertificates 的解决方案:

Eventually I found solution for Untrusted SSLCertificates:

ProfilesIni allProfiles = new ProfilesIni();
System.setProperty("webdriver.firefox.profile","your custom firefox profile name");
String browserProfile = stem.getProperty("webdriver.firefox.profile");
FirefoxProfile profile = allProfiles.getProfile(browserProfile); 
profile.setAcceptUntrustedCertificates (true); 
webdriver = new FirefoxDriver(profile); 

这篇关于使用 WebDriver 处理 UntrustedSSL 证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆