tls:收到长度为XXXXX的超大记录 [英] tls: oversized record received with length XXXXX

查看:213
本文介绍了tls:收到长度为XXXXX的超大记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用这样的内置标准SSL套接字客户端库(net + crypto / tls):

  conn, err:= net.Dial(tcp,exploit.im:5222)
// ...
config:= tls.Config {InsecureSkipVerify:true}
tls_conn:= tls.Client(conn,& config)
fmt.Println(tls_conn.Handshake())




conn,err:= net.Dial(tcp,exploit.im:5222 )


我设法发现它与默认最大数据包大小(common.go中设置的16384 + 2048: 31)。有没有标准的解决方法(不修补此值并重建库)? 如果您尝试与未用SSL回复的对等方进行SSL握手,则会收到此类消息。 在这种情况下,它可能是一些XMPP服务器,在使用SSL开始之前,首先使用XMPP进行一些明文握手。尝试直接启动SSL会导致将服务器明文响应解释为SSL框架,从而导致出现像这样的奇怪错误消息。


I use the built-in standard SSL socket client library (net + crypto/tls) like this:

conn, err := net.Dial("tcp", "exploit.im:5222")
//...
config := tls.Config{InsecureSkipVerify: true}
tls_conn := tls.Client(conn, &config)
fmt.Println(tls_conn.Handshake())

And am getting the message:

conn, err := net.Dial("tcp", "exploit.im:5222")

I managed to find out it is somehow related to the default maximum packet size (16384 + 2048 set in common.go:31). Is there any standard work around (without patching this value & rebuilding the lib)?

解决方案

You get this kind of messages if you try to do a SSL handshake with a peer which does not reply with SSL. In this case it is probably some XMPP server and with XMPP you first have some clear text handshake before you start with SSL. Trying to start directly with SSL will result in interpreting the servers clear text response as an SSL frame which can result in strange error messages like this.

这篇关于tls:收到长度为XXXXX的超大记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆