You are doing this:
// NewAPIClient - creates a new API client
func NewAPIClient() Client {
c := &APIClient{}
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkyVerify: true}, // <--- Problem
}
c.client = &http.Client{Transport: tr}
return c
}
But it is InsecureSkipVerify
instead of InsecureSkyVerify
.
Be careful however, because InsecureSkipVerify
controls whether a client verifies the server’s certificate chain and hostname. If InsecureSkipVerify
is true, crypto/tls accepts any certificate presented by the server and any hostname in that certificate. In this mode, TLS is susceptible to machine-in-the-middle attacks unless custom verification is used. This should be used only for testing or in combination with VerifyConnection or VerifyPeerCertificate.