Standard library / crypto/tls

tls.CipherSuites()

Lists implemented suites that are not marked insecure; this is not the enabled-default list. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func CipherSuites() []*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.CipherSuites() {    if s.ID == tls.TLS_AES_128_GCM_SHA256 {      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