问题1
[ec2-user@ip-172-31-12-192 ssl]$ sudo nginx -t
nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/nginx/ssl/www.example.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
解决: 原因是适用了错误的文件,查看文件的Modulus, 发现 ServerCertificate.cer 与 www.example.com.key 的相等,使用 ServerCertificate.cer 即可
$ openssl rsa -in www.example.com.key -modulus | grep Modulus=
writing RSA key
Modulus=982E914BA73698CED6489。。。
$ openssl x509 -in ServerCertificate.cer -modulus | grep Modulus=
Modulus=982E914BA73698CED6489。。。
参考:https://serverfault.com/a/571153
问题2
This server's certificate chain is incomplete. Grade capped to B.
https://www.ssllabs.com/ssltest/analyze.html?d=www.example.com
解决:添加完整的证书链
$ cat ServerCertificate.cer My_CA_Bundle.ca-bundle > www.example.com.cer
$ openssl x509 -in www.example.com.cer -modulus | grep Modulus=
Modulus=982E914BA73698CED6489。。。
网友评论