无法打开 ssl 443 端口服务器
Posted
技术标签:
【中文标题】无法打开 ssl 443 端口服务器【英文标题】:Could not open ssl 443 port server 【发布时间】:2021-06-22 23:05:29 【问题描述】:我有一个托管在dreamcompute 中的外部服务器 可以将其视为虚拟专用服务器(vps)
我已经使用:https://ping.eu/port-chk/ 进行了测试 结果:
xxx.xxx.xxx.xxx:443 port is closed
xxx.xxx.xxx.xxx:80 port is open
xxx.xxx.xxx.xxx:22 port is open
我检查了我的服务器端口在 linux 中是否打开:
username@server:~$ sudo ufw status
Status: active
To Action From
-- ------ ----
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
22/tcp ALLOW Anywhere
3306/tcp ALLOW Anywhere
80/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
22/tcp (v6) ALLOW Anywhere (v6)
3306/tcp (v6) ALLOW Anywhere (v6)
我可以通过
在内部访问网络服务器http://localhost/
https://example.com/
http://example.com/
我用代码设置了一个 index.php:
<?=phpinfo()?>
根据我的经验,这是我的路由器防火墙问题,但我无法控制。 也许是我的 dns 或其他什么?
【问题讨论】:
这是你的防火墙。 DNS 不会导致这种情况。 @user207421 好吧,我先试试,因为我从来没有访问过 Dreamhost 拥有的路由器:3 确保服务实际在端口上运行。在这种情况下,可能会检查您的 HTTP 服务器是否配置为运行 HTTPS。如果服务不响应,端口将显示关闭,即使防火墙没有阻止它。 @TWBennet 服务器运行良好。我可以访问 example.com 和 example.com 和 localhost 【参考方案1】:检查端口需要执行的步骤: 验证您是否可以从本地计算机连接...您可以在 localhost (127.0.0.1) 以及您计算机的 IP 地址上远程登录到端口 443。(您已经完成了我所看到的。)您应该至少得到一个答案(即验证该端口上有一个侦听器)。
举个例子:
$ telnet 127.0.0.1 443
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
这确认端口正在监听
$ telnet 127.0.0.1 443
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
我们也可以通过检查 NETSTAT 来做到这一点
$ netstat -antl | grep 443
tcp 0 0 127.0.0.1:52421 127.0.0.1:443 TIME_WAIT
tcp6 0 0 :::443 :::* LISTEN
对于 SSL,我们可以使用 openSSL
$ openssl s_client -connect 127.0.0.1:443
CONNECTED(00000003)
...
您可能必须在路由器或网络防火墙上打开和/或转发地址。
希望一切顺利!! 如果不告诉我们,我们会研究更多的解决方案!
【讨论】:
我已经通过格式化我的云服务器解决了这个问题,是的,它现在可以工作了。谢谢你的解释:)以上是关于无法打开 ssl 443 端口服务器的主要内容,如果未能解决你的问题,请参考以下文章
无法使用端口 443 设置 https 站点。rsa 服务器证书公用名 (cn) 与 SSl 错误日志中的服务器名称不匹配