1.需求场景
配置https访问,相关文件均已得到(jks,pfx crt,cer)。
2.项目环境
apache2.2.27 red hat linux 6.3
3.解决方案
(1)证书转换(使用crt key)
openssl pkcs12 -in server.pfx -nokeys -clcerts -out mycrt.crt
openssl pkcs12 -nocerts -nodes -in server.pfx -out mykey.key
以上两步,若有密码,请输入密码。
(2)编辑 httpd.conf
开启(去掉#)
#LoadModule ssl_module modules/mod_ssl.so
#Include conf/extra/httpd-ssl.conf
(3)编辑 conf/extra/httpd-ssl.conf
SSLCertificateFile /xxx/xxx/xxx/xx/mycrt.crt
SSLCertificateKeyFile /xxx/xxx/xxx/xx/mykey.key
(4)重启apache
sh apachectl start
注意:防火墙配置
引用参考:
https://www.jianshu.com/p/38c4de471b12
https://jingyan.baidu.com/article/ed15cb1b9097a41be2698171.html