Tls: oversized record received by length XXXXX

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

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 I get a message:

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

I managed to find out that this is due to the default maximum packet size (16384 + 2048 set in common.go: 31). Is there any standard work (without fixing this value and rebuilding lib)?

+2
source share
1 answer

You receive such messages if you try to perform SSL handshaking with a peer that does not respond SSL. In this case, it is probably some kind of XMPP server, and with XMPP you first have a clear handshake before you start with SSL. Attempting to start directly with SSL will interpret the server's clear text response as an SSL frame, which can lead to strange error messages like this.

+2
source

All Articles