12345678_0001
如本期所示,您可以访问底层的 http 客户端。这是一个忽略 127.0.0.1:8030 处的自签名证书错误的小示例package mainimport ( "crypto/tls" "github.com/hashicorp/go-retryablehttp" "net/http")func main() { tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } retryClient := retryablehttp.NewClient() retryClient.HTTPClient.Transport = tr req, err := retryablehttp.NewRequest("GET", "https://127.0.0.1:8030", nil) if err != nil { panic(err) } _, err = retryClient.Do(req) if err != nil { panic(err) }}