【发布时间】:2018-06-06 15:59:42
【问题描述】:
我的网站(CentOS 7 上的 Apache 2.4.6)直到昨天都可以正常使用 SSL,但现在当我尝试重新启动服务器时 apache 服务失败了:
$ sudo service httpd restart
$ Enter SSL pass phrase for sitename.com:443 (RSA) : ********
$ Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
这些建议的命令都没有提供太多信息,因此通过检查 ssl_error_log,我找到了以下相关条目:
[ssl:debug] ssl_util_ssl.c(495): AH02412: [sitename.com:443] Cert matches for name 'sitename.com' [ ... (certificate details) ... ]
[ssl:debug] ssl_engine_init.c(984): AH02236: Configuring RSA server private key
[ssl:emerg] AH02238: Unable to configure RSA server private key
[ssl:emerg] SSL Library Error: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch
最后两个条目表示密钥和证书文件不匹配。
配置在/etc/httpd/conf.d/sitename.conf中指定:
SSLCertificateKeyFile /etc/pki/tls/private/sitename.com.key
SSLCertificateFile /etc/pki/tls/certs/sitename.com.crt
SSLCertificateChainFile /etc/pki/tls/certs/IntermediateCA.crt
我运行以下命令查看它们的模数,它们确实匹配:
$ openssl x509 -noout -modulus -in /etc/pki/tls/certs/sitename.com.crt | openssl md5
$ openssl rsa -noout -modulus -in /etc/pki/tls/private/sitename.com.key | openssl md5
所以看起来一切都应该正常工作,但这是我卡住的地方,无法确定错误的原因。
感谢任何建议。感谢您的宝贵时间。
【问题讨论】:
-
最可能的原因是密码错误。你应该尝试用
openssl打印私钥,它也会要求密码,你会看看是不是问题。 -
我能够使用
openssl验证我的密码是否正确。如果有兴趣,请参阅下面的答案