是否有可能使openssl跳过国家/通用名称提示?
有没有办法使openssl skipping的提示,如
Country Name (2 letter code) [US]: Organization Name (eg, company) [My Company Name LTD.]: Common Name (eg, YOUR name) [something]: 在创build证书时
 openssl req -config openssl.cnf -new -x509 ... 
 鉴于这些参数在openssl.cnf文件中提供的事实 
例如
 countryName = Country Name (2 letter code) countryName_default = US countryName_min = 2 countryName_max = 2 0.organizationName = Organization Name (eg, company) 0.organizationName_default = My Company Name LTD. commonName = Common Name (eg, YOUR name) commonName_max = 64 commonName_default = ${ENV::CN} 
	
感谢@indiv
 根据这个指南 – -subj是要走的路,例如 
 -subj '/CN=www.mydom.com/O=My Company Name LTD./C=US' 
 另一个解决scheme是在configuration文件中使用prompt指令。 
 请参阅OpenSsl:configuration文件格式 
 prompt 
如果设置为
no则禁用证书字段的提示,直接从configuration文件中取值。 它还更改了distinguished_name和attributes部分的预期格式。
distinguished name和attribute部分有两种不同的格式。如果提示选项设置为
no则这些部分只包含字段名称和值 :例如,
  CN=My Name OU=My Organization emailAddress=someone@somewhere.org 
这允许外部程序(例如,基于GUI)生成具有所有字段名称和值的模板文件,并将其传递给
req。或者,如果提示选项不存在或未设置为否,则文件包含字段提示信息。 它由以下forms的行组成:
  fieldName="prompt" fieldName_default="default field value" fieldName_min= 2 fieldName_max= 4 
生成一个configuration文件,在[req]部分,你可以把prompt = no。
例如:
 [req] prompt = no distinguished_name = req_distinguished_name req_extensions = v3_req [req_distinguished_name] C = US ST = California L = Los Angeles O = Our Company Llc #OU = Org Unit Name CN = Our Company Llc #emailAddress = info@example.com [v3_req] basicConstraints = CA:FALSE keyUsage = nonRepudiation, digitalSignature, keyEncipherment subjectAltName = @alt_names [alt_names] DNS.1 = example.com DNS.2 = www.example.com 
然后就执行例如
 openssl req -new -sha256 -config THATFILE.conf -key example.com.key -out example.com.csr 
- 受Heartbleed漏洞影响的Windows Server 2012 R2和IIS?
- Chrome:无效的自签名SSL证书 – “主题备用名称缺失”
- 如何从PEM编码证书中确定SSL证书过期date?
- 如何在两种公钥格式之间转换,一个是“BEGIN RSA PUBLIC KEY”,另一个是“BEGIN PUBLIC KEY”
- 您必须启用openssl扩展才能通过https下载文件
- encryption/解密在两个不同的openssl版本之间不能正常工作
- 如何grep或searchOpenSSL的.jar文件?
- 如何使用命令行中的密码生成一个openSSL密钥?
- 正确使用HsOpenSSL API来实现TLS服务器