Zum Inhalt springen

Disabled TLS Validation (ARCH5119)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key go.security.disabled-tls-validation · Severity error · Category security · CWE CWE-295

Setting InsecureSkipVerify: true turns off certificate and hostname validation entirely. This defeats TLS authentication and opens the door to man-in-the-middle (MITM) attacks.

tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
tr := &http.Transport{
TLSClientConfig: &tls.Config{MinVersion: tls.VersionTLS12},
}
client := &http.Client{Transport: tr}

Remove InsecureSkipVerify; if needed, add custom certificates to a trusted RootCAs pool.