Skip to content

Commit

Permalink
Merge pull request PelicanPlatform#234 from Techming/fix-tls
Browse files Browse the repository at this point in the history
Prevent TLSSkipVerify from being overwritten
  • Loading branch information
haoming29 authored and bbockelm committed Oct 16, 2023
2 parents 96d9cc0 + c816ca2 commit 327a2df
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 @@ -275,7 +275,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 327a2df

Please sign in to comment.