标签: ssl tls

[root@ansible ~]# cd /etc/pki/tls/certs/
[root@ansible certs]# make testcert
umask 77 ; \
        /usr/bin/openssl req -utf8 -new -key /etc/pki/tls/private/localhost.key -x509 -days 365 -out /etc/pki/tls/certs/localhost.crt -set_serial 0
Enter pass phrase for /etc/pki/tls/private/localhost.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) [XX]:CN  可选,CN中国
State or Province Name (full name) []:GuangDong 可选,省份
Locality Name (eg, city) [Default City]:Shenzhen 可选,城市
Organization Name (eg, company) [Default Company Ltd]:SUSTC 可选,公司名称
Organizational Unit Name (eg, section) []:ITS 可选,部门

Common Name (eg, your name or your server's hostname) []:Whoru 可选,姓名

Email Address []:zhangkaiyun@szxhinfo.com 可选,邮箱地址

[root@ansible certs]# cd ../private/
[root@ansible private]# ls
localhost.key 此处看到已经生成了一个本地的证书

[root@ansible private]# openssl rsa -in localhost.key -out localhost_nopass.key #生成一个免密码的证书

[root@ansible private]# ll
total 8
-rw------- 1 root root 1766 Mar 14 14:20 localhost.key
-rw-r--r-- 1 root root 1679 Mar 14 14:22 localhost_nopass.key #这是免密码的证书

版权所有:《Hoiwan's 》 => 《[SSL-TLS]本地生成tls测试证书
除非注明,文章均为 《Hoiwan's 》 原创,欢迎转载!转载请注明本文地址,谢谢。