Hello all,
I have been facing an issue when I try to create a HTTP client which needs to connect through a HTTPS proxy using the HTTP CONNEC method. I know that it can be achieved setting my own http.Transport object. However the issue seems to be in the current implementation of /net/http/transport.go code.
In my environment, I am developing a HTTP client which ALWAYS use a HTTPS proxy using HTTP CONNECT method. This client is allowed to reach HTTP or HTTPS targets. Therefore, I noticed that when I try to reach a HTTPS target, the the transport layer works as expected and it uses the HTTP CONNECT method. However, when I try to reach a HTTP target, the transport does not use the CONNECT method.
Looking at the transport.go code, I realized that the check to use the CONNECT method is based on the protocol of the target instead of being on the protocol of the proxy URL. Below is a link showing that:
1. HTTP check
2. HTTPS check
Go version: go version go1.19.3 linux/amd64
Mauro