Có cách nào để tạo các yêu cầu chứng chỉ SSL bằng cách chỉ định tất cả các tham số bắt buộc trên lệnh ban đầu không? Tôi đang viết một bảng điều khiển máy chủ web dựa trên CLI và tôi muốn tránh việc sử dụng mong đợi khi thực thi openssl
nếu có thể.
Đây là một cách điển hình để tạo một yêu cầu chứng chỉ:
$ 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
Tôi hy vọng sẽ thấy một cái gì đó như thế này: (ví dụ không hoạt động)
$ 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
Trang mỹ không có gì để nói về vấn đề này, tôi cũng không thể tìm thấy bất cứ điều gì thông qua Google. Việc tạo yêu cầu chứng chỉ SSL phải là một quá trình tương tác, hoặc có cách nào đó để chỉ định tất cả các tham số trong một lệnh không?
Đây là trên một bản phân phối Linux có nguồn gốc từ Debian đang chạy openssl 1.0.1
.
openssl
lá cờ được ghi lại ở đâu? ב) Bạn đã google cái gì để tìm cái đó? Cảm ơn bạn!
-subj
tham số được ghi chép lại (không phải chi tiết hơn) tại openssl.org/docs/apps/req.html .
openssl.cnf
.