“SSL_CTX_use_PrivateKey_file”是什么意思? “出现密码错误问题” Nginx 错误日志中指出?

发布于 2025-01-08 10:34:55 字数 1826 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

櫻之舞 2025-01-15 10:34:55

删除密钥密码:

openssl rsa -in key.pem -out newkey.pem

如果证书和密钥在一起:

openssl rsa -in mycert.pem -out newcert.pem
openssl x509 -in mycert.pem >>newcert.pem

来源: http: //www.madboa.com/geek/openssl/#key-removepass

Remove the key pass phrase:

openssl rsa -in key.pem -out newkey.pem

If the certificate and the key are together:

openssl rsa -in mycert.pem -out newcert.pem
openssl x509 -in mycert.pem >>newcert.pem

Source: http://www.madboa.com/geek/openssl/#key-removepass

离鸿 2025-01-15 10:34:55

我明白了...与 nginx 使用的私钥文件必须没有有密码。我删除了密码并且它起作用了。

I got it... the private key file used with nginx must not have a passphrase. I removed the passphrase and it worked.

听闻余生 2025-01-15 10:34:55

因为您使用密码生成 .crt 文件,所以您需要在 Nginx conf 中为 .key 和 .crt 文件指定相同的密码,如下所示

server {
    ssl_password_file /path-to-your-passphrase/ssl.pass;
}

请参阅 Nginx Doc

或者,如果您不需要证书文件的密码,只需使用ssh-keygen 工具生成文件如下:

ssh-keygen -t rsa

Because you generate the .crt file with a passphrase, so you need to specify the same passphrase for your .key and .crt file in Nginx conf like this

server {
    ssl_password_file /path-to-your-passphrase/ssl.pass;
}

See Nginx Doc

Or if you don't need the passphrase for your cert file, just use ssh-keygen tool to generate the file as following:

ssh-keygen -t rsa
剑心龙吟 2025-01-15 10:34:55

这个问题现在有点老了,nginx 实际上至少从 1.2 版本开始就支持启动时询问密码。但这个问题仍然是相关的,因为在最新版本(带有 nginx 1.6 的版本 8)中,此功能已从 debian 中删除。原因是 nginx 的 systemd 脚本中尚未实现密码短语输入,而 apache 则已实现。手动启动 nginx 很简单,而且这也不是什么问题,因为无论如何都需要手动干预,这里没有使用 systemd。

参考: https://forum.nginx.org/read.php ?2,262900,262931#msg-262931

The question is a bit old now, and nginx actually supports passphrase asking at startup since at least version 1.2. But the issue is still relevant because this capability has been removed from debian in the latest release, version 8 with nginx 1.6. The reason is that passphrase input hasn't been implemented in the systemd script for nginx, while it has been for apache. Launching nginx manually simply works, and it's not too a problem since manual intervention is required anyway, there's no use of systemd here.

Reference: https://forum.nginx.org/read.php?2,262900,262931#msg-262931

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文