gpt4 book ai didi

google-chrome - 如何停止 Chrome 的选择证书窗口?

转载 作者:太空宇宙 更新时间:2023-11-03 12:56:46 24 4
gpt4 key购买 nike

我正在处理一个 Selenium 项目,我需要测试的系统正在使用 SSL 证书。每次当我尝试登录时,我们都会看到我们无法使用 WebDriver 处理的“选择证书”窗口。

Chrome select a certificate window

我试过使用 AutoItx 单击“确定”按钮,如下所示。但是 Send("{ENTER}") 并不是最好的选择。

if (AutoItX.WinWaitActive("data:, - Google Chrome", "", 10) == 0)
{
AutoItX.WinActivate("data:, - Google Chrome");
AutoItX.Send("{ENTER}");
}

有没有一种方法可以使用 AutoItX 单击“确定”按钮?或者有没有办法在使用 Capabilities 定义 ChromeDriver 时加载此证书?

最佳答案

Chrome 版本 59.0.3071.86(64 位),Win 7 企业版:

创建注册表项:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\AutoSelectCertificateForUrls  

此处创建名称为 1 的新字符串值 (REG_SZ)

作为值数据输入:

{"pattern":"[*.]","filter":{}}

This is how the registry then looks like.

有关此 key 的更多信息,我找到了:

The value must be an array of stringified JSON dictionaries. Each dictionary must have the form { "pattern": "$URL_PATTERN", "filter" : $FILTER }, where $URL_PATTERN is a content setting pattern. $FILTER restricts from which client certificates the browser will automatically select. Independent of the filter, only certificates will be selected that match the server's certificate request. If $FILTER has the form { "ISSUER": { "CN": "$ISSUER_CN" } }, additionally only client certificates are selected that are issued by a certificate with the CommonName $ISSUER_CN. If $FILTER is the empty dictionary {}, the selection of client certificates is not additionally restricted.

关于 Automatically select client certificates for these sites

Chrome 版本 87.0.4280.141(64 位),Win 10 企业版:

创建注册表项:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\AutoSelectCertificateForUrls  

此处创建名称为 1 的新字符串值 (REG_SZ)

作为值数据输入:

{"pattern":"[*.]mycompany.com","filter":{"ISSUER":{"CN":"MyCompanyCA"}}}

enter image description here

MyCompanyCA 和子域 mycompany.com 必须替换为您相应的 url 和发行公司。

关于google-chrome - 如何停止 Chrome 的选择证书窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40653785/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com