Created
December 26, 2024 03:38
-
-
Save mag5323/e8e3229299d85c9e10dc79d3921f2323 to your computer and use it in GitHub Desktop.
Fortify: Insecure Randomness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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