Standard library / crypto/tls

tls.InsecureCipherSuites()

Lists implemented cipher suites with known security issues. Inspect for compatibility only; do not enable them in new applications. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func InsecureCipherSuites() []*CipherSuite

Return Value

[]*CipherSuite

Result of the operation; handle any returned error before using other results.

Working Example

Example Snippetgo
package main
import (  "crypto/tls"  "fmt")
func main() {  found := false  for _, s := range tls.InsecureCipherSuites() {    if s.ID == tls.TLS_RSA_WITH_RC4_128_SHA {      found = true    }  }  fmt.Println(found)}
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference