问题原文
原帖链接 · Daniel · CC BY-SA 3.0
In /etc/ssl, when I do sudo openssl verify mywebsite.pem I get a message stating
mywebsite.pem: OU = GT46830179, OU = See www.rapidssl.com/resources/cps (c)15, OU = Domain Control Validated - RapidSSL(R), CN = *.logitapp.com
error 20 at 0 depth lookup:unable to get local issuer certificate
I created mywebsite.key by copying from sslpoint's certificate generator into nano. I created mywebsite.pem by running sudo cat mywebsite.crt sslpointintermediate.crt >> mywebsite.pem . Created mywebsite.crt and sslpointintermediate.crt by pasting into nano from the email sslpoint sent me.
mywebsite.pem and mywebsite.key aren't actually the names of the files.
Using Debian 8. Trying to get nginx and gunicorn working with ssl. Having problems with that and I think it's (at least partially) because the ssl certificates somehow aren't installed correctly, as indicated by the above output. How can I resolve this?
EDIT:
In a previous version of this question I was also asking about 'openssl verify'ing the .key file. I've removed that part of the question as there's no point in trying that.
社区高分解答
原帖链接 · Seb35 · CC BY-SA 4.0
If you want to use openssl verify, you should instead use:
openssl verify -CAfile your-intermediates-and-final.pem mywebsite.crt
with your-intermediates-and-final.pem with all intermediate and final (trusted anchor) concatenated inside, in PEM format. If you want to use the -CApath /etc/ssl/certs option, each intermediate certificate must be in the /etc/ssl/certs directory and you must execute as root:
$ c_rehash
nginx seems to be correctly configured. Verify the permissions are correct and you have the two following config parameters in your server {} or http {} section:
ssl_certificate /path/to/your/mywebsite.pem;
ssl_certificate_key /path/to/your/mywebsite.key;
and in your server {} section:
listen 443 ssl;
EDIT - this was a part of answer to the original question:
The key only contains the private key and no certificate, so there is no point in "openssl verify"ing it.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
