简体   繁体   English

SSL库错误(密钥值不匹配),但是证书文件确实匹配

[英]SSL Library Error (key values mismatch), but the certificate files DO match

My site (Apache 2.4.6 on CentOS 7) was working fine with SSL until yesterday, but now the apache service fails when I try to restart my server: 直到昨天,我的站点(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.

Neither of those suggested commands give much info, so by checking the ssl_error_log, I find the following relevant entries: 这些建议的命令都没有提供太多信息,因此通过检查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

The last two entries indicate that the key and cert files do not match. 最后两个条目指示密钥文件和证书文件不匹配。 The configuration is specified in /etc/httpd/conf.d/sitename.conf : 该配置在/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

I run the following to look at their modulus, and they do indeed match: 我运行以下命令查看它们的模数,它们确实匹配:

$ 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

So it seems like everything should be working, but this is where I am stuck and cannot determine the cause of the error. 因此,似乎一切都应该正常工作,但这是我遇到的问题,无法确定错误原因。

Any advice is appreciated. 任何建议表示赞赏。 Thank you for your time. 感谢您的时间。

I figured it out. 我想到了。 Not sure exactly which package changed from my yum update command, but my guess is that one of them was responsible. 不知道从我的yum update命令中确切更改了哪个程序包,但是我猜测是其中一个负责。

Anyways, I had to remove the password protection from my certificate's private key file: 无论如何,我必须从证书的私钥文件中删除密码保护:

$  openssl rsa -in [sitename.com.key] -out [sitename.com.key]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM