如何停止 Chrome 的选择证书窗口? [英] How to stop Chrome's Select a certificate window?
问题描述
我正在处理一个 Selenium 项目,我需要测试的系统正在使用 SSL 证书.每次当我尝试登录时,我们都会收到此选择证书";我们无法使用 WebDriver 处理的窗口.
我已尝试使用 AutoItx 单击确定"按钮,如下所示.但是 Send("{ENTER}")
不是最好的选择.
if (AutoItX.WinWaitActive("data:, - Google Chrome", "", 10) == 0){AutoItX.WinActivate(数据:,-谷歌浏览器");AutoItX.Send("{ENTER}");}
有没有办法使用 AutoItX 单击确定"按钮?或者有什么方法可以在使用 Capabilities 定义 ChromeDriver 时加载这个证书?
Chrome Version 59.0.3071.86 (64-Bit), Win 7 Enterprise:
创建注册表项:
HKEY_LOCAL_MACHINESOFTWAREPoliciesGoogleChromeAutoSelectCertificateForUrls
此处创建名称为 1 的新字符串值 (REG_SZ)
作为值数据输入:
{"pattern":"[*.]","filter":{}}
MyCompanyCA 和子域 mycompany.com 必须替换为您对应的 url 和发行公司.
I'm working on a Selenium project and the system I need to test is using an SSL certificate. Every time when I try to login we are getting this "Select a certificate" window which we cannot handle with WebDriver.
I have tried clicking OK button using AutoItx as below. But the Send("{ENTER}")
is not the best option.
if (AutoItX.WinWaitActive("data:, - Google Chrome", "", 10) == 0)
{
AutoItX.WinActivate("data:, - Google Chrome");
AutoItX.Send("{ENTER}");
}
Is there a way to click on OK button using AutoItX? Or is there a way we can load this certificate when defining ChromeDriver by using Capabilities?
Chrome Version 59.0.3071.86 (64-Bit), Win 7 Enterprise:
Create registry key:
HKEY_LOCAL_MACHINESOFTWAREPoliciesGoogleChromeAutoSelectCertificateForUrls
Here create new String value (REG_SZ) with name 1
As Value data enter:
{"pattern":"[*.]","filter":{}}
This is how the registry then looks like.
For more information on this key I found:
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.
on Automatically select client certificates for these sites
Chrome Version 87.0.4280.141 (64-Bit), Win 10 Enterprise:
Create registry key:
HKEY_LOCAL_MACHINESOFTWAREPoliciesGoogleChromeAutoSelectCertificateForUrls
Here create new String value (REG_SZ) with name 1
As Value data enter:
{"pattern":"[*.]mycompany.com","filter":{"ISSUER":{"CN":"MyCompanyCA"}}}
MyCompanyCA and the subdomain mycompany.com must be replaced with your corresponding url and issuing company.
这篇关于如何停止 Chrome 的选择证书窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!