如何转换 PFX 证书文件以便在 Linux 服务器上与 Apache 一起使用?
我从 Windows 证书服务创建了 PFX。 PFX 包含整个证书链。 (这只是一个根证书和主证书,没有中间证书。)
引导我,智者。
最佳答案
与 OpenSSL您可以使用下一个命令将 pfx 转换为 Apache 兼容格式:
openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.cer
openssl pkcs12 -in domain.pfx -nocerts -nodes -out domain.key
第一个命令将公钥提取到 domain.cer
。
第二个命令将私钥提取到 domain.key
。
更新您的 Apache 配置文件:
<VirtualHost 192.168.0.1:443>
...
SSLEngine on
SSLCertificateFile /path/to/domain.cer
SSLCertificateKeyFile /path/to/domain.key
...
</VirtualHost>
关于apache - 如何转换 PFX 证书文件以便在 Linux 服务器上与 Apache 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8774574/