Closed iamatsundere closed 3 years ago
Okay, my solution is
tr := http.DefaultTransport.(*http.Transport)
tr.TLSClientConfig.InsecureSkipVerify = true
client := &http.Client{Transport: tr}
httpClient := httpclient.NewClient(
httpclient.WithHTTPClient(client),
httpclient.WithHTTPTimeout(timeout),
httpclient.WithRetryCount(3),
)
And this was mine: (pretty similar) -
tr := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}
client := &http.Client{Transport: tr}
httpClient := httpclient.NewClient(
httpclient.WithHTTPClient(client),
httpclient.WithHTTPTimeout(timeout),
httpclient.WithRetryCount(retryCount),
)
res, err := httpClient.Get(conf.HTTPRequestConfig.URL, nil)
Hi, I just want to set
InsecureSkipVerify = true
, how can I do that. Be cause when I make a call to this address, the return is responed like this:Post "https://my-uri.com": x509: certificate is not valid for any names, but wanted to match my-uri.com