大体流程:
1. 先建立一把 private key 预备提供给 SSL 凭证签名要求所用;
2. 最后建立 SSL 凭证 (test certificates)。
建立凭证文件
[root@bird certs]# cd /etc/pki/tls/certs/
[root@bird certs]# make xxx.key
[root@bird certs]# mv xxx.key xxx.key.raw
[root@bird certs]# openssl rsa -in xxx.key.raw -out xxx.key
[root@bird certs]# rm -f xxx.key.raw
[root@bird certs]# chmod 400 xxx.key
[root@bird certs]# make xxx.crt SERIAL=随即数字 (避免本机生成多个crt 浏览器识别时会有错误)
根据提示输入
[root@bird certs]# ll xxx.*
-rw-------. 1 root root 1407 11月 26 07:53 xxx.crt
-r--------. 1 root root 1675 11月 26 07:49 xxx.key
修改ssl.conf内容 使用自制凭证
[root@www ~]# vim /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/pki/tls/certs/xxx.crt <==約在 105 行
SSLCertificateKeyFile /etc/pki/tls/certs/xxx.key <==約在 112 行
不过一般还是选择购买
转载于:https://blog.51cto.com/wanjiadi/1877454