【发布时间】:2023-04-03 13:01:01
【问题描述】:
来自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 模块已开启。
在 Windows 主机文件中正确定义了 www.vhost.dev。
当我加载 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 和.key,当我尝试通过@987654338 加载第二个虚拟主机时,问题随之而来@。自从我从新重新安装 Windows 后才存在此问题。
更新 2:在 Windows cmd 中运行 netsh int ipv4 install 后,错误变为:
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,但没有应用答案或答案 cmets 中的解决方案。
更新 5:我从 WAMPServer 2.5 升级到 WAMPServer 3,问题仍然存在。
更新 6:我发现我在 httpd-ssl.conf 中的 <VirtualHost> 条目中引用了在 C:\wamp\bin\apache\apache2.4.9\conf\ssl.crt 或 @987654346 中不存在的密钥和证书@。
这些 <VirtualHost> 条目来自我之前安装的 Windows 10。
我注释掉了错误的条目,因此剩下的唯一 <VirtualHost> 条目是那些具有有效 .crt 和 .key 文件的条目。但是,同样的错误SSL_ERROR_RX_RECORD_TOO_LONG 仍然存在于 Firefox 中。
【问题讨论】:
-
好像 apache 没有监听 443 端口。检查一下这个serverfault.com/a/475130,可能对你有帮助
-
谢谢@Rajesh。我添加了
Listen 10.1.1.1:443,其中10.1.1.1是我的主机IP 地址。我现在收到:This site can’t provide a secure connection. www.vhost.dev sent an invalid response. ERR_SSL_PROTOCOL_ERROR。我在 Chrome 中单击诊断,Windows 疑难解答打开,但 can't fix the errors - see screenshot。 -
我尝试重新安装 TCP/IP 4,但收到 this error。我尝试使用此 SuperUser thread 中的 MajorGeeks 工具重新安装 Winsock,但它无法解决浏览器
https错误。 -
我假设那是 WAMPServer 2.5!有什么理由不安装 WAMPServer3?
标签: ssl-certificate wamp wampserver