conn, err := tls.Dial("tcp", fmt.Sprintf("%s:%d", *server, *port), &tls.Config{})
if err != nil {
panic("failed to connect: " + err.Error())
}
// Get the ConnectionState struct as that's the one which gives us x509.Certificate struct
connectionState := conn.ConnectionState(
How do we get the conn.ConnectionState object when I’ve to go via a HTTP proxy? I tried looking at tls.Config struct but it doesn’t contain anything helpful.
Using a Proxy does not have anything to do with TLS. A TLS Connect happens after the actual connection has been made. You need to look at using a Proxy with a normal HTTP client. I think you need to specify your own Transport. This Stack Overflow should be helpful http://stackoverflow.com/questions/14661511/setting-up-proxy-for-http-client