Firstly, never ever ever use InsecureSkipVerify: true
no matter how convenient it may seem. Instead set something like:
tls.Config {
ServerName: "test-as.sgx.trustedservices.intel.com",
Certificates: []tls.Certificate{pair}
}
Second, initializing http.Transport
- to pass your custom tls.Config - also zeros out all the other default http.Transport
settings that come with the default http.Client
.
Some of those zero defaults may force behavior you might not expect. See here on how to restore some of those original defaults.