大网数据广告活动
服务器运维问答

'openssl verify' outputs 'unable to get local issuer certificate'

· 52CE 我爱测

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 erro…

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-09-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。