Skip to content

Instantly share code, notes, and snippets.

@mag5323
Created December 26, 2024 03:38
Show Gist options
  • Save mag5323/e8e3229299d85c9e10dc79d3921f2323 to your computer and use it in GitHub Desktop.
Save mag5323/e8e3229299d85c9e10dc79d3921f2323 to your computer and use it in GitHub Desktop.
Fortify: Insecure Randomness
func NewPusher(host string, isSkipVerify bool) *Pusher {
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: isSkipVerify,
PreferServerCipherSuites: true,
}, // cause Insecure Randomness
MaxIdleConnsPerHost: 100,
MaxConnsPerHost: 100,
IdleConnTimeout: 60 * time.Second,
}
client := &http.Client{Transport: tr}
return &Pusher{
host: host,
client: client,
isSkipVerify: isSkipVerify,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment