使用openssl生成crt证书
- 检查是否安装了 openssl
- 创建证书密钥文件
- 创建证书申请文件:
- 备份一份服务器密钥文件
- 去除文件口令
- 生成证书文件
转发:/p/30f7d7e9539d
检查是否安装了 openssl
[root@DEV-YWZTV1-SE02 conf]# openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013
创建证书密钥文件
使用 openssl 命令,创建服务器证书 密钥文件 :
openssl genrsa -des3 -out 1024
下面要输入密码:可随意定义,现在把密码设置成123456,密码后面会用到。
创建证书申请文件:
使用 openssl 命令,创建服务器证书 申请文件:
openssl req -new -key -out
输出内容为:
Enter pass phrase for : ← 输入前面创建的密码
Country Name (2 letter code) [AU]:CN ← 国家代号,中国输入CN
State or Province Name (full name) [Some-State]:BeiJing ← 省的全名,拼音
Locality Name (eg, city) []:BeiJing ← 市的全名,拼音
Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany Corp. ← 公司英文名
Organizational Unit Name (eg, section) []: ← 可以不输入
Common Name (eg, YOUR name) []: ← 此时不输入
Email Address []:admin@ ← 电子邮箱,可随意填
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []: ← 可以不输入
An optional company name []: ← 可以不输入
备份一份服务器密钥文件
cp
去除文件口令
openssl rsa -in -out
生成证书文件
openssl x509 -req -days 365 -in -signkey -out