openssl生成https证书文件

1、生成key文件

openssl genrsa -des3 -out https.key 1024

会提示输入密码,根据提示设置密码即可

Enter pass phrase for https.key:

Verifying - Enter pass phrase for https.key:

2、生成csr文件

openssl req -new -key https.key -out https.csr

如果提示输入密码,就输入生成key时输入的密码。

//国家
Country Name (2 letter code) [AU]:CN
//省
State or Province Name (full name) [Some-State]:GD
//市
Locality Name (eg, city) []:SZ
//组织名称
Organization Name (eg, company) [Internet Widgits Pty Ltd]:IPC
//可不写
Organizational Unit Name (eg, section) []:IPC
//一般写网站域名
Common Name (e.g. server FQDN or YOUR name) []:IPC
//邮箱
Email Address []:IPC

Please enter the following 'extra' attributes
to be sent with your certificate request
//可不写
A challenge password []:
//可不写
An optional company name []:

3、生成crt文件

openssl x509 -req -days 3650 -in https.csr -signkey https.key -out https.crt