Skip to content

crypto/tls: RequireAndVerifyClientCert is not working as intended. #63120

Description

@Manikishore-S

What version of Go are you using (go version)?

$ go version

go1.19.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes i tried using docker container with latest released observed the same behavior

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/manikishore.s/Library/Caches/go-build"
GOENV="/Users/manikishore.s/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/manikishore.s/go/pkg/mod"
GONOPROXY="github.com/Manikishore-S"
GONOSUMDB="github.com/Manikishore-S"
GOOS="darwin"
GOPATH="/Users/manikishore.s/go"
GOPRIVATE="github.com/Manikishore-S"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.19.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.19.2/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.19.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/q0/chzy5trn5s17x4d7k4mg38qhw1k3zr/T/go-build1144696972=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Start a crypto/tls-based webserver with mtls config as show below.
tlsConfig := &tls.Config{ ClientCAs: caCertPool, ClientAuth: tls.RequireAndVerifyClientCert, }

What did you expect to see?

You may expect to see a client certificate is getting exchanged for verification.

What did you see instead?

A TLS handshake without client certificate exchange.
image

I have tried with other option requestClientCertificate etc but none of them worked. seems a bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions