配置Apache支持HTTPS(2)

配置Apache支持HTTPS

(4)生成证书签署请求文件web-vhosts-com.csr

# openssl req -new -key /etc/httpd/ssl/web-vhosts-com.key -days 7300 -out /etc/httpd/ssl/web-vhosts-com.csr

配置Apache支持HTTPS

其中web.vhosts.com为证书颁发的对象

(5)将证书签署请求文件web-vhosts-com.csr发送至192.168.1.146

# scp /etc/httpd/ssl/web-vhosts-com.csr root@192.168.1.146:/etc/pki/CA/certs

8、192.168.1.146签署证书并发还给192.168.1.145

(1)签署证书:

# openssl ca -in /etc/pki/CA/certs/web-vhosts-com.csr -days 7300 -out /etc/pki/CA/certs/web-vhosts-com.crt

配置Apache支持HTTPS

备注:ca子命令常用选项

ca:用于签署证书请求的OpenSSL子命令

-in web-vhosts-com.csr:证书签署请求文件路径

-days 7300:证书的有效期限为20

-out web-vhosts-com.crt:证书的保存路径

更多ca子命令选项可查看:# man ca

配置Apache支持HTTPS

(2)将证书web-vhosts-com.crt发还给192.168.1.145

# scp /etc/pki/CA/certs/web-vhosts-com.crt root@192.168.1.145:/etc/httpd/ssl

(3)192.168.1.145查看证书信息:

# openssl x509 -in /etc/httpd/ssl/web-vhosts-com.crt -noout -text       //显示的信息多

# openssl x509 -in /etc/httpd/ssl/web-vhosts-com.crt -noout -subject

# openssl x509 -in /etc/httpd/ssl/web-vhosts-com.crt -noout -serial

备注:

使用私钥web-vhosts-com.key和证书web-vhosts-com.crt生成微软专用证书web-vhosts-com.crt.pfx

# cd /etc/httpd/ssl

# openssl pkcs12 -export -out web-vhosts-com.pfx -inkey web-vhosts-com.key -clcerts -in web-vhosts-com.crt

配置Apache支持HTTPS

使用微软专用证书web-vhosts-com.pfx生成私钥web-vhosts-com.key和证书web-vhosts-com.crt

# openssl pkcs12 -in web-vhosts-com.pfx -nodes -out web-vhosts-com.pem

# openssl rsa -in web-vhosts-com.pem -out web-vhosts-com.key

# openssl x509 -in web-vhosts-com.pem -out web-vhosts-com.crt

 

9、192.168.1.145配置Apache支持SSL

(1)安装SSL模块:# yum -y install mod_ssl

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/a2b10aa8a6b03726fe19686a6c7186d1.html