Standard library / crypto/tls
tls.ECHRejectionError
Indicates ECH rejection; RetryConfigList may hold retry configurations. Verify the rejection according to the ECH protocol and configuration; this fixture constructs only a synthetic error. Expected stdout: 'true 2\n'.
Formal Syntax & Structure
go syntaxgo
type ECHRejectionError struct { RetryConfigList []byte}Working Example
Example Snippetgo
package main
import ( "crypto/tls" "errors" "fmt")
func main() { var err error = &tls.ECHRejectionError{RetryConfigList: []byte{1, 2}} var rejected *tls.ECHRejectionError fmt.Println(errors.As(err, &rejected), len(rejected.RetryConfigList))}
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) }}