简体   繁体   English

“未知SSL协议错误”是什么意思?

[英]What does “Unknown SSL protocol error” mean?

Here's my problem: I'm using a trading bot to interact with an online exchange. 这是我的问题:我正在使用交易机器人与在线交易所进行交互。 The bot is actually a script in PHP that has an infinite loop. 该机器人实际上是PHP中的一个具有无限循环的脚本。 In each iteration it uses cURL requests to send/receive some data to/from server. 在每次迭代中,它使用cURL请求向/从服务器发送/接收一些数据。 Sometimes (not really often) I get error 443 (Unknown SSL protocol). 有时(不是很经常)我收到错误443(未知SSL协议)。 It makes me think that the source of the problem is remote server rather than my requests. 它使我认为问题的根源是远程服务器,而不是我的请求。

I'm not an expert in security so I would welcome general answer or link to get a bit deeper. 我不是安全方面的专家,所以我欢迎您提供一般性的答案或链接以进一步了解。

That usually means the remote server did not provide a SSL/TLS response. 这通常意味着远程服务器不提供SSL / TLS响应。 Rather, the remove server sent a web page in response to the ClientHello and the local client tried to interpret the HTML as a ServerHello . 相反,删除服务器发送了一个网页以响应ClientHello ,本地客户端尝试将HTML解释为ServerHello

You can simulate it with openssl s_client -connect www.google.com:80 . 您可以使用openssl s_client -connect www.google.com:80对其进行仿真。 In this example, port 80 will clearly get you a web page rather than a ServerHello . 在此示例中,端口80显然将为您提供网页,而不是ServerHello The line of interest is the one that begins with read from ... . 感兴趣的行是read from ...开始的行。

$ openssl s_client -connect www.google.com:80 -debug
CONNECTED(00000003)

write to 0x7fe933c22a70 [0x7fe934013600] (308 bytes => 308 (0x134))
0000 - 16 03 01 01 2f 01 00 01-2b 03 03 2e 0b 3b 5f 7a   ..../...+....;_z
...
0120 - 02 04 03 03 01 03 02 03-03 02 01 02 02 02 03 00   ................
0130 - 0f 00 01 01                                       ....

read from 0x7fe933c22a70 [0x7fe934018c00] (7 bytes => 7 (0x7))
0000 - 48 54 54 50 2f 31 2e                              HTTP/1.
140735324471772:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:787

---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 308 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM