我们在 Ubuntu apache 服务器上托管了一个应用程序,并且 letsencrypt SSL 也安装在那里。现在我想用 Digicert 证书替换 Letsencrypt ssl 证书。我按照 Digicert ssl 安装文档操作,但当我尝试启动 apache 服务器时,它失败了。检查错误日志后,我发现了以下错误。
AH02565: Certificate and private key urbaninspirations.biz:443:0 from /etc/cert/domain_name.crt and /etc/cert/domain_name.key do not match
AH00016: Configuration Failed
下面是我的“000-default-le-ssl.conf”页面脚本
<VirtualHost *:443>
ServerName domain_name.biz
ServerAlias www.domain_name.biz
SSLEngine On
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
### This is using in Letsencrypt SSL certificates
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain_name.biz/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain_name.biz/privkey.pem
### Change this for DigiCert SSL certification but getting error when enable below line
#SSLCertificateFile /etc/cert/domain_name.crt
#SSLCertificateKeyFile /etc/cert/domain_name.key
#SSLCertificateChainFile /etc/cert/DigiCertCA.crt
</VirtualHost>
有人能指出我做错的事情的正确方向吗?
答案1
私钥必须与您使用的证书(公钥)匹配。否则您将无法一起使用它们。
确保密钥和证书匹配(证书来自正在使用的私钥)的一种方法是使用 openssl 检查它们的模数。
openssl rsa -in file.key -noout -modulus
openssl x509 -in file.crt -noout -modulus
Note: If certificate or key are not in ASCII you must add "-inform DER" to the specific file.
两个命令的输出必须相同。