是否可以通过在初始命令上指定所有必需的参数来创建SSL证书请求的方法?我写一个基于CLI的Web服务器的控制面板和我想避免使用预期执行时,openssl
如果可能的话。
这是创建证书请求的典型方法:
$ openssl req -new -newkey rsa:2048 -nodes -sha256 -keyout foobar.com.key -out foobar.com.csr
Generating a 2048 bit RSA private key
.................................................+++
........................................+++
writing new private key to 'foobar.com.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) [AU]:US
State or Province Name (full name) [Some-State]:New Sweden
Locality Name (eg, city) []:Stockholm
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Scandanavian Ventures, Inc.
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:foobar.com
Email Address []:gustav@foobar.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:FooBar
我希望看到这样的内容:( 不起作用的示例)
$ openssl req -new -newkey rsa:2048 -nodes -sha256 -keyout foobar.com.key -out foobar.com.csr \
-Country US \
-State "New Sweden" \
-Locality Stockholm \
-Organization "Scandanavian Ventures, Inc." \
-CommonName foobar.com \
-EmailAddress gustav@foobar.com \
-Company FooBar
精美的手册页对此无话可说,我也无法通过Google找到任何东西。SSL证书请求生成必须是交互式过程,还是有某种方法可以在单个命令中指定所有参数?
这是在Debian衍生的Linux发行版上运行的openssl 1.0.1
。
2
jamescoyle.net/how-to/...
—
ceejayoz
@ceejayoz:很好,谢谢。א)这些
—
dotancohen 2014年
openssl
标志在哪里记录?ב)您在Google上找到了什么?谢谢!
我用Google搜索“ CSR生成脚本”。该
—
ceejayoz 2014年
-subj
参数在openssl.org/docs/apps/req.html上有详细记录(不是很详细)。
也可以创建一个通常称为的配置文件
—
sebix
openssl.cnf
。