您好,登錄后才能下訂單哦!
[nginx@machina key]$ pwd
/app/nginx/key
[nginx@machina key]$ openssl req -new -key server.key -out server.csr
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]:cn
State or Province Name (full name) []:gd
Locality Name (eg, city) [Default City]:gz
Organization Name (eg, company) [Default Company Ltd]:ai
Organizational Unit Name (eg, section) []:ai
Common Name (eg, your name or your server's hostname) []:112.96.28.206
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[nginx@machina key]$
[nginx@machina key]$ ls
old server.csr server.key
4. 備份一份服務器密鑰文件
cp server.key server.key.org
5. 去除文件口令
openssl rsa -in server.key.org -out server.key
6. 生成證書文件server.crt
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
[nginx@machina key]$ openssl rsa -in server.key.org -out server.key
writing RSA key
[nginx@machina key]$
[nginx@machina key]$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=/C=cn/ST=gd/L=gz/O=ai/OU=ai/CN=112.96.28.206
Getting Private key
一般只需三步:
1. openssl genrsa -out server.key 2048
2. openssl req -new -key server.key -out server.csr
3. openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
關于密碼:
openssl genrsa -out server.key 2048
不需要密碼。
openssl genrsa -des3 -out server.key 2048
需要密碼。
https://www.jianshu.com/p/9523d888cf77
關于域名:
用openssl,域名可以不輸;
用keystore,必須輸入。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。