goproxy icon indicating copy to clipboard operation
goproxy copied to clipboard

When starting the HTTPS proxy MITM, it displays the error: “tls: first record does not look like a TLS handshake.”

Open moxcomic opened this issue 1 year ago • 0 comments

Because most of the requests are HTTPS, but there are one or two HTTP requests, I need to use ListenAndServeTLS. I attempted to check for HTTP requests in proxy.OnRequest().HandleConnect() and forward them directly, but that method never gets called, and I immediately receive the error: “tls: first record does not look like a TLS handshake.” I suspect that HTTP requests simply cannot pass through this way. However, if I use ListenAndServe, HTTPS requests won’t work. Is there any solution to handle both HTTP and HTTPS requests in this scenario?

moxcomic avatar Mar 03 '25 01:03 moxcomic