openssl 中 -nodes 参数的目的是什么?
openssl 中的 -nodes
参数的用途是什么?
What is the purpose of the -nodes
argument in openssl?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
openssl 中的 -nodes
参数的用途是什么?
What is the purpose of the -nodes
argument in openssl?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
选项
-nodes
不是英文单词“nodes”,而是“no DES”。当作为参数给出时,这意味着 OpenSSL 不会加密 PKCS#12 文件中的私钥。要加密私钥,您可以省略
-nodes
,您的密钥将使用 3DES-CBC 加密。为了加密密钥,OpenSSL 会提示您输入密码,并使用该密码通过密钥派生函数 EVP_BytesToKey。根据您的 OpenSSL 版本和编译选项,您也许能够提供这些选项来代替
-nodes
:最终在库级别 OpenSSL 调用函数 PEM_write_bio_PrivateKey 以及您选择的加密算法(或缺少加密算法)。
The option
-nodes
is not the English word "nodes", but rather is "no DES". When given as an argument, it means OpenSSL will not encrypt the private key in a PKCS#12 file.To encrypt the private key, you can omit
-nodes
and your key will be encrypted with 3DES-CBC. To encrypt the key, OpenSSL prompts you for a password and it uses that password to generate an encryption key using the key-derivation function EVP_BytesToKey.Depending on your version of OpenSSL and compiled options, you may be able to provide these options in place of
-nodes
:Ultimately at the library level OpenSSL calls the function PEM_write_bio_PrivateKey with the encryption algorithm (or lack thereof) you choose.
编辑: nginx v1.7.3 添加了 ssl_password_file 指令从指定文件中读取密码,并在上下文的 encrypted-private.key
indiv 上尝试每个密码,该
-nodes
参数正确意味着 OpenSSL 将创建未加密的private.key;否则,将会出现密码短语提示,要求您创建加密的私有密钥。请参阅 req、pkcs12, CA.pl但是,我认为(对于程序员而言)目的是因为:
http { }
或server { }
上下文中指定ssl_password_file file.keys;
。 [参考]-nodes
创建不加密的private.key有用:锁定 private.key
sudo chown root:ssl-cert private.key
- change 所有者private.key到root用户,ssl-cert组sudo chmod 640 private.key
- 更改private.key的访问权限 现在,对于所有者 R/W、组 R选项 A
更强的安全性,但是当服务器重新启动时,必须<强>手动输入密码加密的私有密钥
选项B
中等安全性,并且可能在A/C
选项C 之间取得良好的平衡强>
安全性较弱,但不提示输入未加密的 private.key 密码
edit: nginx v1.7.3 has added an ssl_password_file directive which reads passphrases from a specified file trying each passphrase on the context's encrypted-private.key
indiv is correct that the
-nodes
argument means that OpenSSL will create UNencrypted private.key; otherwise, there will be a passphrase prompt to create encrypted-private.key. see req, pkcs12, CA.plhowever, I feel the purpose (for programmers) is because:
ssl_password_file file.keys;
inhttp { }
orserver { }
context. [ref]-nodes
to create private.key without encryptionuseful: lock down private.key
sudo chown root:ssl-cert private.key
- change owner of private.key to root user, ssl-cert groupsudo chmod 640 private.key
- change access permissions of private.key to owner R/W, group ROption A
stronger security, yet when server restarts, have to manually type in passphrase for encrypted-private.key
Option B
medium security, and probably good balance between A/C
Option C
weaker security, yet NOT prompted for UNencrypted private.key passphrase