gpt4 book ai didi

.htaccess - Chrome 不提示输入客户端证书

转载 作者:太空宇宙 更新时间:2023-11-03 13:34:21 25 4
gpt4 key购买 nike

近三天来,我一直在尝试设置客户端证书身份验证,但无济于事。

我已经在 heliohost 上注册了一个免费域,并安装了由 Let's encrypt 颁发的免费 ssl 证书。

我的计划是拥有自签名证书并在稍后根据数据库检查它们(用于用户身份验证)因此我在 htaccess 文件中将我的 SSLVerifyClient 设置为 optional_no_ca。我安装了几个由 openssl 生成的自签名证书,但无论我尝试使用哪种浏览器(Chrome、Firefox 或 IE),当我尝试通过 Chrome 在手机上访问它时,都没有提示选择证书除外 ,在这种情况下,它会提供安装证书,因为我的手机上没有任何证书。

这是我的 .htaccess 文件的内容:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

SSLOptions +StdEnvVars
SSLRequireSSL
SSLVerifyDepth 1
SSLVerifyClient optional_no_ca

我非常感谢有关此问题的任何反馈,这是我第一次尝试实现此功能,我不确定问题是否出在我的设置或 chrome 上。

我也在用 chrome 59

克里斯

最佳答案

您省略了 ssl 证书颁发机构配置的一部分。需要配置签署客户端证书的 CA 证书(参见 this

 SSLCACertificateFile "conf/ssl.crt/ca.crt"

服务器没有发送根 CA,那么由于您已将 SSLVerifyClient 设置为 optional_no_ca,浏览器会自动执行连接,因为它找不到任何合适的证书(见下面的 TLS1.2 注释)

由于您在服务器中设置了optional_no_ca,因此即使没有提供证书,它也会接受连接。如果您设置了 require,您会发现与 Chrome 的连接失败。

SSLCACertificateFile 在 .htaccess 中不可配置。由于不能自定义chrome,恐怕需要配置这个参数来强制证书提示


当证书列表为空时,浏览器之间的行为可能会有所不同,因为 TLS 规范允许这样做

参见 TLS1.2 RFC

7.4.4. Certificate Request

certificate_authorities

A list of the distinguished names [X501] of acceptable certificate_authorities, represented in DER-encoded format. These distinguished names may specify a desired distinguished name for a root CA or for a subordinate CA; thus, this message can be used to describe known roots as well as a desired authorization space. If the certificate_authorities list is empty, then the client MAY send any certificate of the appropriate ClientCertificateType, unless there is some external arrangement to the contrary.

7.4.6. Client Certificate

[...] If the client does not send any certificates, the server MAY at its discretion either continue the handshake without client authentication, or respond with a fatal handshake_failure alert.

关于.htaccess - Chrome 不提示输入客户端证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44853561/

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