SSL https weird message: first record does not look like a tls handshake [SOLVED]

Hey there, I’m using the following code to serve https, everything is going well, client sees the page as expected, no ssl error, everything working, no log is generated, but the message; “first record does not look like a tls handshake.” shows up almost every second, this message is printed hundreds of times. Below the code that I use;

	err := http.ListenAndServeTLS(":81", PastaCertSSL+"hlsatsslcrt.pem", PastaCertSSL+"server.key", nil)
	if err != nil {
		GeraLog(err.Error())
	}

Client access using the correct url;

https://sub.mydomain.tld:81/

Anyone know how to fix it?

This means someone connected and tried to speak not-TLS. Perhaps you have image links with plain http in them, or something similar.

1 Like

That’s a rest API, there’s no image and no HTML insde that, it’s just a rest API that writes a json to the output…

What do you mean by client? Is it web browser or something else?

1 Like

I meant my customer, sorry.

Are you sure their http client really use TLS?

1 Like

I found the mistery, that rest api feeds an Android app and some of the devices were still out of date and trying to connect the old http url, as the url was the same and at the same port having the https as the only difference, the devices were reaching the new tls, that’s why the handshake warning. Thanks guys.

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