TLS: oversized record received with length 20037

Below is the tls server code I wrote in go.
When i run the code go gives the error
"tls: oversized record received with length 20037"
I have not figured out how to solve this problem.

I am already grateful for any help , Thanks

cert , err := tls.LoadX509KeyPair("certs/server.pem","certs/server.key")
if err != nil{
	fmt.Println("Cert load error : " , err.Error())

config := &tls.Config{
config.Rand = rand.Reader

tlsServ,err := tls.Listen("tcp",":8889",config)
if err != nil {
	fmt.Println("TLS Error : " , err.Error() )

I found comments on Reddit and GitHub indicating that the error can occur if one side uses plain HTTP rather than HTTPS.

Since your code uses tls.Listen on TCP level (rather than http.ListenAndServeTLS), the above comments might not directly apply to your situation; but maybe the behavior is similar at TCP level, which could mean that the other side that connects to this server does not use correct TLS (or no TLS at all).

Just a wild guess though.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.