[root@localhost ~]#openssl req -new -x509 -key /etc/pki/CA/private/cakey.pem -days 7300 -out /etc/pki/CA/cacert.pem
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) []:shandong
Locality Name (eg, city) [Default City]:qingdao
Organization Name (eg, company) [Default Company Ltd]:pojun.tech
Organizational Unit Name (eg, section) []:Opt
Common Name (eg, your name or your server's hostname) []:ca.pojun.tech
Email Address []:
# 生成自己的证书申请文件,以 .csr 结尾的文件。
[root@centos6 ssl]$openssl req -new -key /etc/httpd/conf.d/ssl/httpd.key -out /etc/httpd/conf.d/ssl/httpd.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) []:shandong
Locality Name (eg, city) [Default City]:yantai
Organization Name (eg, company) [Default Company Ltd]:pojun.tech
Organizational Unit Name (eg, section) []:opt
Common Name (eg, your name or your server's hostname) []:*.a.com
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:4、将证书请求文件发送给证书颁发机构(主机B)
# 前面我们说过,证书文件都存放在/etc/httpd/conf.d/ssl/目录下
[root@localhost ~]#scp /etc/pki/CA/certs/httpd.crt 172.18.2.66:/etc/httpd/conf.d/ssl/
The authenticity of host '172.18.2.66 (172.18.2.66)' can't be established.
RSA key fingerprint is 00:c0:e5:a6:39:e9:a7:bb:1b:f4:ab:0d:75:9b:38:b0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.18.2.66' (RSA) to the list of known hosts.
root@172.18.2.66's password:
httpd.crt 100% 3714 3.6KB/s 00:00