--- src/net/http/server.go.orig 2020-11-23 15:19:14.974088616 -0700 +++ src/net/http/server.go 2021-02-01 18:40:55.925786146 -0700 @@ -1819,7 +1819,7 @@ // TLS, assume they're speaking plaintext HTTP and write a // 400 response on the TLS conn's underlying net.Conn. if re, ok := err.(tls.RecordHeaderError); ok && re.Conn != nil && tlsRecordHeaderLooksLikeHTTP(re.RecordHeader) { - io.WriteString(re.Conn, "HTTP/1.0 400 Bad Request\r\n\r\nClient sent an HTTP request to an HTTPS server.\n") + io.WriteString(re.Conn, "HTTP/1.0 400 Bad Request\r\nx-use-https: yes\r\nConent-Type: text/html\r\n\r\nuse https\r\n") re.Conn.Close() return }