使用 WebDriver 处理 UntrustedSSLcertificates

编程入门 行业动态 更新时间:2024-10-12 22:30:05
本文介绍了使用 WebDriver 处理 UntrustedSSLcertificates的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在 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 处理 UntrustedSSLcertificates

本文发布于:2023-10-28 04:43:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535557.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:WebDriver   UntrustedSSLcertificates

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!