我更新了关于甘地的证书如下:
sudo openssl genrsa -des3 -out mywebsite.com_encrypted.key 4096
sudo openssl req -new -key mywebsite.com_encrypted.key -out mywebsite.com.csr
cd /etc/nginx/ssl/
sudo nano mywebsite.com.crt # > pasted the Gandi certificate in this file
sudo wget https://www.gandi.net/static/CAs/GandiStandardSSLCA.pem
sudo cat GandiStandardSSLCA.pem >> mywebsite.com.crt
sudo openssl rsa -in mywebsite.com_encrypted.key -out mywebsite.com.key
sudo chown root:root mywebsite.com.key
sudo chmod 400 mywebsite.com.key对于旧的证书,一切都进行得很好,但是由于我用新证书更新了配置,这里是我在nginx上的日志。我不能重启:
Nginx日志:
2015/05/12 20:53:03 [emerg] 7515#0: SSL_CTX_use_PrivateKey_file("/etc/nginx/ssl/mywebsite.com.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)过程怎么了?
nginx的配置是可以的。
这里是我的nginx配置:
ssl on;
ssl_certificate /etc/nginx/ssl/mywebsite.com.crt;
ssl_certificate_key /etc/nginx/ssl/mywebsite.com.key;发布于 2015-05-12 23:37:56
我不知道你想达到什么目的。看起来您替换了/etc/nginx/ssl/mywebsite.com.key中的密钥,使原始证书/etc/nginx/ssl/mywebsite.com.crt保持不变( mywebsite.com.crt证书仍然绑定到原始密钥--而且不能更改--公钥是X509证书的组成部分)。这正是openssl试图告诉您的--您正试图使用原始创建的具有不同私钥的证书。
顺便说一句:我也不知道为什么您创建了一个证书请求(以及新的密钥),然后将它保留为未使用(而没有实际使用它来创建新的证书)。
https://stackoverflow.com/questions/30201595
复制相似问题