func parseClientAuthType()

in internal/config/config.go [268:288]


func parseClientAuthType(clientAuth string) (tls.ClientAuthType, error) {
	switch strings.ToLower(clientAuth) {
	// if nothing is provided, assume that
	// the user does not want to enable any form
	// of client authentication
	case "":
		fallthrough
	case "noclientcert":
		return tls.NoClientCert, nil
	case "requestclientcert":
		return tls.RequestClientCert, nil
	case "requireanyclientcert":
		return tls.RequireAnyClientCert, nil
	case "verifyclientcertifgiven":
		return tls.VerifyClientCertIfGiven, nil
	case "requireandverifyclientcert":
		return tls.RequireAndVerifyClientCert, nil
	default:
		return -1, fmt.Errorf("unknown client auth type %s: supported values can be found at https://pkg.go.dev/crypto/tls#ClientAuthType", clientAuth)
	}
}