devops-kung-fu / bomber

Scans Software Bill of Materials (SBOMs) for security vulnerabilities
https://devops-kung-fu.github.io/bomber/
Mozilla Public License 2.0
516 stars 45 forks source link

Clone transport #231

Closed myhops closed 2 months ago

myhops commented 3 months ago

The current version of bomber does not work in environments that require a proxy to access the internet. Instead of using a bare http.Transport with the modified tls timeout, I use a clone http.DefaultTransport with the modified TLSHandshakeTimeout.

func init() {
    // Cloning the transport ensures a proper working http client that respects the proxy settings
    transport := http.DefaultTransport.(*http.Transport).Clone()
    transport.TLSHandshakeTimeout = 60 * time.Second
    client = resty.New().SetTransport(transport)
}
myhops commented 2 months ago

My pleasure. Great project

myhops commented 1 month ago

Thanks for accepting, cheers