mirror of
https://github.com/portainer/portainer.git
synced 2025-08-07 14:55:27 +02:00
fix(linter): add linter rules to reduce the chance for invalid FIPS settings BE-11979 (#975)
This commit is contained in:
parent
dc273b2d63
commit
d00d71ecbf
13 changed files with 140 additions and 46 deletions
|
@ -1,7 +1,6 @@
|
|||
package networking
|
||||
|
||||
import (
|
||||
"crypto/fips140"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -73,14 +72,11 @@ func ProbeTelnetConnection(url string) string {
|
|||
func DetectProxy(url string) string {
|
||||
client := &http.Client{
|
||||
Transport: &http.Transport{
|
||||
TLSClientConfig: crypto.CreateTLSConfiguration(),
|
||||
TLSClientConfig: crypto.CreateTLSConfiguration(true),
|
||||
},
|
||||
Timeout: 10 * time.Second,
|
||||
}
|
||||
|
||||
// TODO: use fips.CanTLSSkipVerify() instead
|
||||
client.Transport.(*http.Transport).TLSClientConfig.InsecureSkipVerify = !fips140.Enabled()
|
||||
|
||||
result := map[string]string{
|
||||
"operation": "proxy detection",
|
||||
"local_address": "unknown",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue