【原创】nginx - SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch

blogdaren 2015-12-12 抢沙发 2992人次

问题背景:

重启 SSL nginx报错:

root@developer:~# service nginx restart 
Restarting nginx: nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/nginx/conf.d/ssl/ssl.key") failed 
(SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch) 
nginx: configuration file /etc/nginx/nginx.conf test failed 

问题原因:

SSL证书和SSL私钥不匹配

it has a mismatch between your key and certificate 

解决方法:

重新生成SSL证书配置即可

相关技巧:

借助如下两个命令就可以检验SSL 证书 和 SSL 私钥是否一致:

Check an MD5 hash of the public key to ensure that it matches with what is in a private key:
openssl x509 -noout -modulus -in certificate.crt | openssl md5
openssl rsa  -noout -modulus -in privateKey.key  | openssl md5 

版权声明:除非注明,本文由( blogdaren )原创,转载请保留文章出处。

本文链接:【原创】nginx - SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch

发表评论:

您的昵称:
电子邮件:
个人主页: