SSL: error:0B080074:x509 certificate routines:X509

[root@real-nginx conf.d]# nginx -t
nginx: [emerg] SSL_CTX_use_PrivateKey("/etc/pki/tls/private/www.ty.com.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
nginx: configuration file /etc/nginx/nginx.conf test failed

错误原因:密钥值不匹配
解决方法:
首先使用OpenSSL将证书文件和密钥文件解码,看一下证书和密钥的md5值是不是一致的

[root@real-nginx certs]# openssl x509 -noout -modulus -in /etc/pki/CA/certs/www.ty.com.crt |openssl md5
(stdin)= 08287ad351f5ab11b84aeb196cd130c3
# 查看私钥的md5值
[root@real-nginx certs]# openssl rsa -noout -modulus -in /etc/pki/tls/private/www.ty.com.key | openssl md5
(stdin)= 1bf516b926162f0e64499ea20a147983
# 查看证书的md5值
# 额,MD5值真的不一样,咦,可能是我填写信息操作的有点快了,哈哈,搞乱了

哼,我和你说,这种情况就不能惯着它,直接删了,下一个

你可能感兴趣的:(SSL: error:0B080074:x509 certificate routines:X509)