Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tls: oversized record received with length XXXXX

Tags:

ssl

go

starttls

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)?

like image 327
Gonzalez Avatar asked Dec 14 '25 02:12

Gonzalez


1 Answers

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.

like image 143
Steffen Ullrich Avatar answered Dec 15 '25 17:12

Steffen Ullrich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!