3 apache openssl httpd.conf ssl-certificate
我正在尝试导出客户端证书以用于Web浏览器.
目标是使用<Location>指令限制访问管理区域.我看过很多关于使用自签名CA的教程.你会如何使用第三方做到这一点?
1)如果CA是受信任的根CA,是否需要在客户端pfx中包含CA?我见过这两个例子.
没有CA:
openssl pkcs12 -export -inkey KEYFILENAME -in CERTFILEFILENAME -out XXX.pfx
Run Code Online (Sandbox Code Playgroud)
使用CA:
openssl pkcs12 -export -in my.crt- inkey my.key -certfile my.bundle -out my.pfx
Run Code Online (Sandbox Code Playgroud)
2)我是否还需要在httpd.conf设置中为可信CA包含SSLCACertificateFile?
SSLVerifyClient none
SSLCACertificateFile conf/ssl.crt/ca.crt
<Location /secure/area>
SSLVerifyClient require
SSLVerifyDepth 1
</Location>
Run Code Online (Sandbox Code Playgroud)
小智 5
您无法使用第三方CA签名证书颁发客户端证书.您必须拥有自签名CA才能颁发客户端证书,并将此CA指定为SSLCACertificateFile
样品:
SSLCertificateFile /etc/apache2/ssl/apache.cer # site certificate signed by verisign
SSLCertificateKeyFile /etc/apache2/ssl/apache.key # site key for certificate signed by verisign
SSLCACertificateFile /etc/apache2/ssl/apachelca2.pem # your self signed CA
Run Code Online (Sandbox Code Playgroud)
请注意,其中apachelca2.pem包含密钥和证书...命令行以颁发客户端证书:
openssl req -config /usr/share/apache2/ssleay.cnf -new -key client.key -out client.csr
openssl x509 -req -days 365 -CA /etc/apache2/ssl/apachelca2.pem -CAkey /etc/apache2/ssl/apachelca2.pem -CAcreateserial -in client.csr -extfile /usr/share/apache2/ssleay.cnf -extensions v3_req -out client.crt
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5196 次 |
| 最近记录: |