func SendReq(req *http.Request,result interface{}) error {
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport:tr}
resp,err := client.Do(req)
if err != nil{
fmt.Printf("Fail exec http client Do,err:%s\n",err.Error())
return err
}
...
}
關鍵是在上面代碼中 tr
變量中將 tls.Config
給跳過