Cle*_*ann 6 linux ssl firewall telnet
我在从我的一台服务器连接到 https 站点时遇到了一个奇怪的问题。
当我输入:
telnet puppet 8140
Run Code Online (Sandbox Code Playgroud)
我看到了一个标准的 telnet 控制台,可以像往常一样与服务器通信:
Connected to athena.hidden.tld.
Escape character is '^]'.
GET / HTTP/1.1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Reason: You're speaking plain HTTP to an SSL-enabled server port.<br />
Instead use the HTTPS scheme to access this URL, please.<br />
<blockquote>Hint: <a href="https://athena.hidden.tld:8140/"><b>https://athena.hidden.tld:8140/</b></a></blockquote></p>
<hr>
<address>Apache/2.2.16 (Debian) Server at athena.hidden.tld Port 8140</address>
</body></html>
Connection closed by foreign host.
Run Code Online (Sandbox Code Playgroud)
但是当我尝试使用 ssl 连接到相同的主机和端口时:
openssl s_client -connect puppet:8140
Run Code Online (Sandbox Code Playgroud)
它不工作
connect: No route to host
connect:errno=113
Run Code Online (Sandbox Code Playgroud)
我很迷惑。起初听起来像是防火墙问题,但这不可能,是吗?因为这也会阻止 telnet 连接。
作为防火墙,我在两台服务器上都使用 ferm。这些系统是 debian 挤压 vm-boxes。
[编辑 1]
即使我尝试直接与 IP 地址连接:
openssl s_client -connect 198.51.100.1:8140 #address exchanged
connect: No route to host
connect:errno=113
Run Code Online (Sandbox Code Playgroud)
关闭两台主机上的防火墙
service ferm stop
Run Code Online (Sandbox Code Playgroud)
也没有帮助。
但是当我这样做时
openssl s_client -connect localhost:8140
Run Code Online (Sandbox Code Playgroud)
在服务器机器上它连接正常。
[编辑 2]
如果我使用 telnet 连接到 IP,它也无法正常工作。
telnet 198.51.100.1 8140
Trying 198.51.100.1...
telnet: Unable to connect to remote host: No route to host
Run Code Online (Sandbox Code Playgroud)
混淆可能来自 IPv6。我的所有主机上都有 IPv6。似乎 telnet 默认使用 IPv6,这有效。例如:
telnet -6 puppet 8140
Run Code Online (Sandbox Code Playgroud)
有效但
telnet -4 puppet 8140
Run Code Online (Sandbox Code Playgroud)
不起作用。所以似乎是 IPv4 路由有问题。openssl 似乎只(或默认情况下)使用 IPv4,因此失败,但 telnet 使用 IPv6 并成功。
你能检查一下是否能ping通目标主机吗?(IPv4) 看来
这可能只是一个归结为 IPv4 连接无法连接到目标主机的问题。您的 IPv4 路由在两台机器上都正常吗?
| 归档时间: |
|
| 查看次数: |
15059 次 |
| 最近记录: |