1.在云主机服务器上搭建好APACHE+MYSQL+PHP环境,使用沃通证书进行HTTPS配置,一切正常,用https://xxx.xxx.xxx可以正常访问项目
2.由于是进行微信开发,需要在本地直接和服务器进行通信,因此想要在本地也进行HTTPS的配置,本机和云主机使用的APACH+MYSQL+PHP环境是一模一样的,配置也基本相同,不相同的地方无非是一些路径,但是发现重启APACHE就报错,无法正常启动,启动了也无法使用HTTPS进行访问
3.我使用了NGROK内网穿透,并且之前用HTTP访问本地时是没有问题的,重新配置NGROK的HTTPS协议进行访问,确实是访问到了我的机器,但是报错如下:
Bad Request
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
Tunnel https://xxx.xxx.com unavailable(地址手动打码)
Unable to initiate connection to 192.168.0.99:443. A web server must be running on port 192.168.0.99:443 to complete the tunnel.
也就是说通过该地址是访问到了我的机器,但是没有检测到对应端口的服务,我的443端口已监听,并且APACHE也启动了,就是在error日志里报错
本机apache部分配置如下:
ServerName 127.0.0.1
UseCanonicalName Off
EnableSendfile Off
EnableMMAP Off
AcceptFilter http none
AcceptFilter https none
Listen 80
Listen 443
LoadModule ssl_module modules/mod_ssl.so
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include conf/ssl.conf
ssl.conf内容如下
SSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
SSLProtocol all -SSLv2 -SSLv3
<VirtualHost *:443>
ServerName www.xxx.com
SSLEngine on
SSLCertificateFile "d:/Server/ssl/2_xxx.crt"
SSLCertificateKeyFile "d:/Server/ssl/3_xxx.key"
SSLCertificateChainFile "d:/Server/ssl/1_root_bundle.crt"
DocumentRoot d:/wwwroot/xxx
SSLOptions +StdEnvVars
</VirtualHost>
重启apache的时候报错如下:
[Sat Oct 01 23:43:23.958922 2016] [ssl:debug] [pid 12612:tid 384] ssl_engine_pphrase.c(179): AH02199: SSL not enabled on vhost 127.0.0.1:443, skipping SSL setup
[Sat Oct 01 23:43:23.959922 2016] [ssl:info] [pid 12612:tid 384] AH02200: Loading certificate & private key of SSL-aware server 'www.xxx.com:443'
[Sat Oct 01 23:43:23.960922 2016] [ssl:debug] [pid 12612:tid 384] ssl_engine_pphrase.c(237): AH02202: Init: Read server certificate from 'D:/Server/ssl/2_www.xxx.com.crt'
[Sat Oct 01 23:43:23.960922 2016] [ssl:debug] [pid 12612:tid 384] ssl_engine_pphrase.c(504): AH02249: unencrypted RSA private key - pass phrase not required
[Sat Oct 01 23:43:23.961922 2016] [ssl:debug] [pid 12612:tid 384] ssl_engine_pphrase.c(179): AH02199: SSL not enabled on vhost 127.0.0.1:80, skipping SSL setup
[Sat Oct 01 23:43:23.961922 2016] [ssl:info] [pid 12612:tid 384] AH01887: Init: Initializing (virtual) servers for SSL
[Sat Oct 01 23:43:23.961922 2016] [ssl:info] [pid 12612:tid 384] AH01914: Configuring server www.xxx.com:443 for SSL protocol
[Sat Oct 01 23:43:23.961922 2016] [ssl:debug] [pid 12612:tid 384] ssl_engine_init.c(788): AH01904: Configuring server certificate chain (2 CA certificates)
[Sat Oct 01 23:43:23.961922 2016] [ssl:debug] [pid 12612:tid 384] ssl_engine_init.c(327): AH01893: Configuring TLS extension handling
[Sat Oct 01 23:43:23.961922 2016] [ssl:debug] [pid 12612:tid 384] ssl_engine_init.c(835): AH02232: Configuring RSA server certificate
[Sat Oct 01 23:43:23.962922 2016] [ssl:debug] [pid 12612:tid 384] ssl_util_ssl.c(407): AH02412: [www.xxx.com:443] Cert matches for name 'www.xxx.com' [subject: CN=www.www.xxx.com,C=CN / issuer: CN=CA \\E6\\B2\\83\\E9\\80\\9A\\E5\\85\\8D\\E8\\B4\\B9SSL\\E8\\AF\\81\\E4\\B9\\A6 G2,O=WoSign CA Limited,C=CN / serial: 447857DB5FA985D0F3F6D1831AE29AD5 / notbefore: Sep 26 08:37:43 2016 GMT / notafter: Sep 26 08:37:43 2019 GMT]
[Sat Oct 01 23:43:23.962922 2016] [ssl:debug] [pid 12612:tid 384] ssl_engine_init.c(890): AH02236: Configuring RSA server private key
[Sat Oct 01 23:43:23.962922 2016] [ssl:warn] [pid 12612:tid 384] AH01916: Init: (127.0.0.1:443) You configured HTTP(80) on the standard HTTPS(443) port!
[Sat Oct 01 23:43:23.962922 2016] [ssl:info] [pid 12612:tid 384] AH01876: mod_ssl/2.4.7 compiled against Server: Apache/2.4.7, Library: OpenSSL/1.0.1e