package main import ( "crypto/tls" "net/http" ) func main() { tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true},} client := &http.Client{Transport: tr} url := "https://www.baidu.com" var err error var req *http.Request var resp *http.Response if req,err = http.NewRequest("GET",url,nil); err != nil { println(err.Error()) return } if resp,err = client.Do(req); err != nil { println(err.Error()) return } defer resp.Body.Close() switch resp.TLS.Version { case tls.VersionSSL30: println("SSLV3") case tls.VersionTLS10: println("TLSv1") case tls.VersionTLS11: println("TLSv1.1") case tls.VersionTLS12: println("TLSv1.2") } }