我在这里读过How to do a https request with bad certificate?,但也要给出错误信息:
tls:服务器的证书包含不受支持的公共密钥类型: * dsa.PublicKey
这是我的代码:
tr := http.DefaultTransport.(*http.Transport)
tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
client := &http.Client{Transport: tr}
response, err := client.Get(httpsUrl)
if err != nil {
fmt.Println(err)
return
}
defer response.Body.Close()
body, _ := ioutil.ReadAll(response.Body)
c.JSON(200, gin.H{"payload": body})
该如何解决?