We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用的版本
报错文件 util/http.go#293
util/http.go#293
// httpWithTLS CA 证书 func httpWithTLS(rootCa, key string) (*http.Client, error) { var client *http.Client certData, err := os.ReadFile(rootCa) if err != nil { return nil, fmt.Errorf("unable to find cert path=%s, error=%v", rootCa, err) } cert := pkcs12ToPem(certData, key) config := &tls.Config{ Certificates: []tls.Certificate{cert}, } trans := (DefaultHTTPClient.Transport.(*http.Transport)).Clone() trans.TLSClientConfig = config trans.DisableCompression = true client = &http.Client{Transport: trans} return client, nil }
trans := (DefaultHTTPClient.Transport.(*http.Transport)).Clone()
DefaultHTTPClient.Transport 这个为nil
https://go.dev/play/p/3a4o6ObftCg
The text was updated successfully, but these errors were encountered:
util/http.go 文件第26行可以改成
util/http.go
var DefaultHTTPClient = &http.Client{ Transport: http.DefaultTransport, }
Sorry, something went wrong.
欢迎贡献PR
No branches or pull requests
使用的版本
报错文件
util/http.go#293
DefaultHTTPClient.Transport 这个为nil
复现地址
https://go.dev/play/p/3a4o6ObftCg
The text was updated successfully, but these errors were encountered: