从this answer开始,我创建了:
C:\wamp\bin\apache\apache2.4.9\ssl.crt\vhost.crt
&
C:\wamp\bin\apache\apache2.4.9\ssl.key\vhost.key
我编辑了:
C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-ssl
包括:
<VirtualHost www.vhost.dev:443>
DocumentRoot "c:/wamp/www/vhostdev"
ServerName www.vhost.dev:443
ErrorLog "c:/wamp/logs/ssl_error.log"
TransferLog "c:/wamp/logs/ssl_error.log"
SSLEngine on
SSLCertificateFile "c:/wamp/bin/apache/apache2.4.9/conf/ssl.crt/vhost.crt"
SSLCertificateKeyFile "c:/wamp/bin/apache/apache2.4.9/conf/ssl.key/vhost.key"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "c:/wamp/www/vhostdev">
SSLOptions +StdEnvVars
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "c:/wamp/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
SSL Apache模块已开启。
www.vhost.dev在Windows主机文件中正确定义。
当我加载https://www.vhost.dev时,我会收到:
This site can’t be reached
www.vhost.dev refused to connect.
Try:
Reloading the page
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
C:\wamp\logs\apache_error.txt
Windows Event Viewer > Application
中没有任何内容。
帮助表示赞赏。
更新 :我创建了第二个.crt
&amp; .key
代表第二个虚拟机,当我尝试将第二个虚拟主加载到https
时,问题就出现了。自从我重新安装Windows以来,这个问题才存在。
更新2 :在Windows netsh int ipv4 install
中运行cmd
后,错误已更改为:
This site can’t provide a secure connection.
ERR_SSL_PROTOCOL_ERROR
更新3 :在另一个浏览器Firefox中,错误不同:
An error occurred during a connection to www.vhost.dev. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG
The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.
Update4 :SSL_ERROR_RX_RECORD_TOO_LONG有一个解决方案here,但答案或答案评论中没有一个解决方案适用。
更新5 :我从WAMPServer 2.5升级到WAMPServer 3,问题仍然存在。
更新6 :我发现<VirtualHost>
httpd-ssl.conf
条目中引用的密钥和证书在C:\wamp\bin\apache\apache2.4.9\conf\ssl.crt
中没有出现1}}或C:\wamp\bin\apache\apache2.4.9\conf\ssl.key
。
这些<VirtualHost>
条目来自我之前的Windows 10安装。
我注释掉了错误的条目,因此剩下的唯一<VirtualHost>
条目是那些包含有效。crt
和.key
文件的条目。但是,Firefox中仍存在相同的错误SSL_ERROR_RX_RECORD_TOO_LONG
。
答案 0 :(得分:1)
在my own tutorial之后,它的工作正常。
我看到的唯一区别是SSL虚拟主机定义
我的httpd-ssl.conf
看起来像这样:
Listen 443
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4
SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4
SSLHonorCipherOrder on
SSLProtocol all -SSLv3
SSLProxyProtocol all -SSLv3
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:d:/wamp/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
##
## SSL Virtual Host Context
##
<VirtualHost _default_:443>
DocumentRoot "d:/wamp/www/wamphelpers"
ServerName www.wamphelpers.dev:443
ServerAdmin nopwd@homemail.net
ErrorLog "d:/wamp/logs/wamphelpers-error.log"
TransferLog "d:/wamp/logs/wamphelpers-access.log"
SSLEngine on
SSLCertificateFile "d:/wamp/bin/apache/apache2.4.20/conf/ssl.crt/server.crt"
SSLCertificateKeyFile "d:/wamp/bin/apache/apache2.4.20/conf/ssl.key/server.key"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "d:/wamp/www/wamphelpers">
SSLOptions +StdEnvVars
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "d:/wamp/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
并且唯一真正的区别似乎是您使用了
<VirtualHost www.vhost.dev:443>
我用过
<VirtualHost _default_:443>
我确实需要下载新版本的OpenSSL-Win32,我必须将新版本的libaey32.dll
和ssleay32.dll
复制到我系统上可用的所有PHP版本中
如果必须这样做,请记住这两个文件必须复制到
中\wamp\bin\php\php{version}
和不 apache\bin
文件夹。
然后你应该
wampmanager -> Apache -> Version -> 2.4.9 (click on the version number)
(或您当前正在运行的任何版本)
使WAMPServer正确地将符号链接设置为新文件。