0

I've read here How to do a https request with bad certificate?, but also go give error:

tls: server's certificate contains an unsupported type of public key: *dsa.PublicKey

Here is my code:

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})

How to fix that?

0 Answers0