SSL需要 %{SSL_CLIENT_S_DN_CN}

SSL需要 %{SSL_CLIENT_S_DN_CN}

Q1) 我是 Apache HTTP Server 的新手,我正在尝试为特定上下文配置 SSLRequire。以下是两种情况:

a) 检查 CA 签名证书的属性,它按预期工作:

<Location /https_ca_ba/getItem1>
 SSLVerifyClient require
 SSLVerifyDepth  10
 SSLRequireSSL
 SSLRequire    %{SSL_CLIENT_S_DN_O}  eq "My Org" \
               and %{SSL_CLIENT_S_DN_OU} eq "My Team" \
               and %{SSL_CLIENT_S_DN_CN} eq "<ca-signed-cert>.mycompany.com"
 RequestHeader set Authorization "Basic <base64string>"
 ProxyPass https://internal_host:443/ws/soap/getItem
 ProxyPassReverse https://internal_host:443/ws/soap/getItem
</Location>

b) 检查自签名证书。但是,我收到错误“AH02229:访问代理:https://:443/ws/soap/getItem 失败,原因:未满足 SSL 要求表达式”。我仔细检查了一下,配置的 CN 名称是正确的:

<Location /https_ca_ba/getItem2>
 SSLVerifyClient  none
 SSLRequire    %{SSL_CLIENT_S_DN_CN} eq "<self-signed-cert>.mycompany.com"
 RequestHeader set Authorization "Basic <base64string>"
 ProxyPass https://internal_host:443/ws/simple/getItem
 ProxyPassReverse https://internal_host:443/ws/simple/getItem
</Location>

是不是我配置错误了?

Q2) 有没有办法在 Apache HTTP Server 中配置客户端证书认证?外部方将提供证书。

您能否提一些建议?

谢谢

问候,达蒙

答案1

缺少括号SSLRequire

SSLRequire   ( %{SSL_CLIENT_S_DN_O}  eq "My Org" \
           and %{SSL_CLIENT_S_DN_OU} eq "My Team" \
           and %{SSL_CLIENT_S_DN_CN} eq "<ca-signed-cert>.mycompany.com" )

相关内容