我做了一个OpenSSL的命令,所以我可以使用脚本自动化。 我觉得通过访问不同的问题和网站所有的选项,但对于“一个可选的公司名称”找不到选项,我想“optionalCompanyName”,但它并没有奏效。
(/C) Country Name (2 letter code) [XX]:GB
(/ST) State or Province Name (full name) []:London
(/L) Locality Name (eg, city) [Default City]:London
(/O) Organization Name (eg, company) [Default Company Ltd]:XYZ
(/U) Organizational Unit Name (eg, section) []:XYZ
(/CN) Common Name (eg, your name or your server's hostname) []:- $DOMAIN
(/emailAddress) Email Address [] :- some@some.com
(/challengePassword) A challenge password :- strongpass
(/?) An optional company name []:PROBLEM
请帮忙。
export domain=SOMEDOMAINNAME
openssl req -nodes -newkey rsa:2048 -keyout $domain.key -out $domain.csr -subj "/C=GB/ST=London/L=London/O=XYZ/OU=XYZ UK/CN=$domain/emailAddress=some@some.com/challengePassword=strongpass/optionalCompanyName=PROBLEM"
在多行相同的命令,所以很容易阅读
export domain=SOMEDOMAINNAME
openssl req -nodes -newkey rsa:2048 -keyout $domain.key -out $domain.csr -subj
"/C=GB/ST=London/L=London/O=XYZ/OU=XYZ UK/CN=$domain/emailAddress=some@some.com
/challengePassword=strongpass/optionalCompanyName=PROBLEM"
访问过的链接
- https://www.shellhacks.com/create-csr-openssl-without-prompt-non-interactive/
- https://www.digicert.com/ssl-support/openssl-quick-reference-guide.htm
- https://www.openssl.org/docs/manmaster/man1/req.html#CONFIGURATION_FILE_FORMAT和几个问题#1