net/http: Client cert auth with TLSClientConfig Certificates is not working while using GetCertificates works #34258
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
it does reproduce with the latest Go version in Arch which usually corresponds to the latest release
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I was writing a simple client with client cert authentication. My server allows for this kind of auth along with other possible authentication options. I followed the docs by specifying the
Certificates
field for the transport'sTLSClientConfig
as so:https://play.golang.org/p/il0hsOJ-3UG
In this case, however, the cert and key were ignored for the authentication and since the server handles unauthenticated requests by redirecting somewhere else, this redirect indeed happened.
When I changed setting the
Certificates
field to instead use theGetClientCertificates
, stuff started working and my server was correctly reacting to my client cert authentication attempts. The new, working code:https://play.golang.org/p/llosiOPNNGe
What did you expect to see?
I expected the
Certificates
field to be still working for client cert authWhat did you see instead?
cert/key pair were ignored, no client auth was attempted
The text was updated successfully, but these errors were encountered: