Skip to content

Commit

Permalink
fix: prevent TLSSkipVerify to be overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
haoming29 committed Oct 13, 2023
1 parent 8a87a1f commit c816ca2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,12 @@ func setupTransport() {
systemPool, err := x509.SystemCertPool()
if err == nil {
systemPool.AddCert(caCert)
transport.TLSClientConfig = &tls.Config{RootCAs: systemPool}
// Ensure that we don't override the InsecureSkipVerify if it's present
if transport.TLSClientConfig == nil {
transport.TLSClientConfig = &tls.Config{RootCAs: systemPool}
} else {
transport.TLSClientConfig.RootCAs = systemPool
}
}
}
}
Expand Down

0 comments on commit c816ca2

Please sign in to comment.