Answers:
作为CSR生成的一部分而请求的“挑战密码”不同于用于加密秘密密钥的密码(在密钥生成时或稍后加密明文密钥时被请求-每次启用SSL时再次请求)使用它的服务启动)。
这是一个正在生成的密钥,以及生成的密钥的开头:
$ openssl genpkey -algorithm rsa -out foo.key
............++++++
...++++++
$ head -3 foo.key
-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJ9jNAG4Noy//r/S
eeK/gEgGOV0BZm0CYmgSQGj4P6N3cJsPlGsG80qKTxTFwoEiXnM3BVeBpDdXhGKt
该密钥没有密码。创建时没有提示我输入,也没有输入。现在,让我们生成一个加密密钥:
$ openssl genpkey -algorithm rsa -des3 -out bar.key
...........................................++++++
.....................................++++++
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
$ head -3 bar.key
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQInfwj1iv3icMCAggA
MBQGCCqGSIb3DQMHBAizMHBklBexiwSCAoDtRKf1WtMiVMH7HraGTIG0rlQS6Xuj
因此,应该清楚知道加密的私钥(哪个apache或任何其他启用SSL的服务器在启动时需要对其进行解锁)和明文私钥(在服务启动时不需要进行解锁)的样子。现在,我将从未加密的密钥生成带有质询密码的CSR :
$ openssl req -new -key foo.key
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:asdfasdf
An optional company name []:
-----BEGIN CERTIFICATE REQUEST-----
MIIBmzCCAQQCAQAwQjELMAkGA1UEBhMCWFgxFTATBgNVBAcMDERlZmF1bHQgQ2l0
eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0ZDCBnzANBgkqhkiG9w0BAQEF
AAOBjQAwgYkCgYEAn2M0Abg2jL/+v9J54r+ASAY5XQFmbQJiaBJAaPg/o3dwmw+U
awbzSopPFMXCgSJeczcFV4GkN1eEYq2Cmam3tH6t8mVDh0/UryJSWBsaFm9mh9RF
gIpP0hEkYZTf/0X+X06ukt9S/Id9Z/tVgPsZA3TcNjNhJfVaTm81/4ykq8UCAwEA
AaAZMBcGCSqGSIb3DQEJBzEKDAhhc2RmYXNkZjANBgkqhkiG9w0BAQUFAAOBgQCa
ivuDRBlHOhBjg6wPbH9NvCnvEnxeEAkYi0Sl/Grdo/WCk17e+sv9wgqEW1QSIdbV
XzMeWidurv4AtcATwhfk9tBcYBCTxANkTONzhJG7Yk9OAz8g8Ljo8EEvPf4oHqpw
tBg10DCD2op0lCwL2LBdPO3RG20f/HD6fEXPVxZdOQ==
-----END CERTIFICATE REQUEST-----
只是为了证明密钥还没有神奇地被加密:
$ head -3 foo.key
-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJ9jNAG4Noy//r/S
eeK/gEgGOV0BZm0CYmgSQGj4P6N3cJsPlGsG80qKTxTFwoEiXnM3BVeBpDdXhGKt
于是我又说:“挑战密码”要求作为CSR生成的一部分是不一样的东西用来加密密钥口令。“挑战密码”基本上是您与CSR中嵌入的SSL证书发行者(也称为证书颁发机构或CA)之间的共享秘密随机数,如果有需要,发行者可以使用它来对您进行身份验证。一些SSL证书颁发者比其他人更清楚;看下来在这个页面的底部,看看他们说的是需要挑战密码-这是不是当你重新启动Apache:
如果您选择输入并使用质询密码,则需要确保将该密码保存在安全的地方。如果出于任何原因需要重新安装证书,则需要输入该密码。