Documentation
¶
Overview ¶
Package netutil provides race-free CA bundle loading, HTTP transport cloning, and bounded HTTP client construction without mutating http.DefaultTransport in place.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneDefaultTransport ¶
CloneDefaultTransport clones Go's default transport and attaches TLSConfig if extra CAs are configured, without ever mutating http.DefaultTransport or sharing mutable *tls.Config pointers across callers.
func LoadCertPool ¶
LoadCertPool returns a copy of the system certificate pool augmented with the PEM-encoded certificates read from caFile.
func NewClient ¶
NewClient returns an HTTP client bounded by timeout using a cloned default transport (including any extra CAs configured via SetExtraCAs).
func NewTransport ¶
NewTransport clones Go's default transport and, when caFile is non-empty, configures RootCAs from LoadCertPool(caFile).
func ResetExtraCAs ¶
func ResetExtraCAs()
ResetExtraCAs clears any extra certificate authorities configured via SetExtraCAs.
func SetExtraCAs ¶
SetExtraCAs loads PEM certificates from caFile on top of the system certificate pool for subsequent TLSConfig, CloneDefaultTransport, and NewClient calls. Passing "" clears any previously configured extra CAs. It never mutates http.DefaultTransport in place.
Types ¶
This section is empty.