关于apache 开启 ssl https 支持 TLS1.2 的些事

项目背景

须要搭建一个小程序的服务器,固然要使用https协议
服务器windows service 2012 r2,后台语言是php,服务集成环境装的是appserv2.5 ,apache2.2
证书申请阿里云的,https协议能正常打开,就是小程序请求不了,要求TLS1.2
网上的文章基本都是旧的,并且没有说明apache版本,基本不适合你,仍是要折腾
最后找到文章说apache的httpd版本低不支持TLS1.0以上php

因而下载了最新版的appserv集成环境,apache2.4
基本上不用折腾,开启下就完美web

正文

事先有折腾配置了系统的TLS支持,通常都是注册表的东西,相似这样,但不知有没有起做用
https://blog.csdn.net/kirawoo/article/details/78737242

 httpd.conf中开启(默认应该是开启的)apache

LoadModule ssl_module modules/mod_ssl.so

 
httpd.conf 开启加载配置文件

小程序

注意,这里是:httpd-ahssl.conf ,不是httpd-ssl.conf,windows

到httpd-ahssl.conf里面配置服务器

已经内置好几个虚拟目录,映射不一样的域名到不一样的目录app

选一个来改就好,改下web目录和证书路径,好比:<VirtualHost *:443>ide

 SSLEngine on ServerName localhost:443 SSLCertificateFile "${SRVROOT}/cert/2002590_service.ktfqs.com_public.crt" SSLCertificateKeyFile "${SRVROOT}/cert/2002590_service.ktfqs.com.key"
SSLCertificateChainFile "${SRVROOT}/cert/2002590_service.ktfqs.com_chain.crt"
DocumentRoot "C:/AppServ/www" # DocumentRoot access handled globally in httpd.conf CustomLog "${SRVROOT}/logs/ssl_request.log" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" <Directory "C:/AppServ/www"> Options Indexes Includes FollowSymLinks AllowOverride All Require all granted </Directory> </virtualhost>

ServerName不用绑定域名也能够访问,既然能访问就无论它
另外,原配置中,只有一行key文件,一行公共crt,要本身加一行:工具

SSLCertificateChainFile "${SRVROOT}/cert/2002590_service.ktfqs.com_chain.crt"

进行,不然 ,开发工具里能够请求,但真机上会报错request:fail ssl hand shake error开发工具


重启,完美

相关文章
相关标签/搜索