资源贴
为什么https链接通过客户端软件抓包后还是明文:https://blog.csdn.net/stpeace/article/details/78073288
为什么https链接会显示不安全:https://blog.csdn.net/coding_zhu/article/details/70262677
1、ssl证书:可以申请腾讯的免费证书 https://buy.cloud.tencent.com/ssl?fromSource=ssl
下载以后有以下文件
2、配置 http.conf末尾新增
<VirtualHost *:443> #https默认监听443端口
ServerAdmin #管理员联系方式#
DocumentRoot #项目目录#
ServerName https://127.0.0.1
ServerAlias #服务器别名#
SSLEngine on
#申请证书#
SSLCertificateFile "/usr/local/install/apache/ssl/2_www.jiayuangzs.cn.crt"
SSLCertificateKeyFile "/usr/local/install/apache/ssl/3_www.jiayuangzs.cn.key"
SSLCertificateChainFile "/usr/local/install/apache/ssl/1_root_bundle.crt"
#日志文件#
ErrorLog "logs/https-error.log"
CustomLog "logs/https-access.log" common
#开启ssl
SSLProxyEngine on
<Directory "/usr/local/service">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
#反向代理设置 /表明127.0.0.1:443的所有文件都会被重定向到https://127.0.0.1:8081/
ProxyPass /test http://127.0.0.1:8081/test
ProxyPassReverse /testhttp://127.0.0.1:8081/test
</VirtualHost>
放开注释:
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule ssl_module modules/mod_ssl.so
3、安装时需要开启ssl支持,否者会没有响应模块
./configure --prefix=/usr/local/install/apache/httpd-2.4.37 --with-apr=/usr/local/install/apache/apr-1.6.5 --with-apr-util=/usr/local/install/apache/apr-util-1.6.1 --with-pcre=/usr/local/install/apache/pcre-8.42 --enable-ssl
安装时如果包opensll version too old 可以更新openssl版本
yum install openssl-devel
yum update openssl
4、效果: