Standard library / crypto/tls
tls.RequireAndVerifyClientCert
Require a client certificate and verify its chain using configured client roots. The example prints the numeric identifier, not a negotiated value. Expected stdout: '4\n'.
Formal Syntax & Structure
go syntaxgo
const RequireAndVerifyClientCert ClientAuthType = 4Working Example
Example Snippetgo
package main
import ( "crypto/tls" "fmt")
func main() { fmt.Println(uint16(tls.RequireAndVerifyClientCert)) }
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) }}