Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.8 (this feature was introduced in 1.8)
What operating system and processor architecture are you using (go env)?
Linux (but it doesn't matter here)
What did you do?
Used tls.Dial (or tls.DialWithDialer) without setting ServerName in Config.
What did you expect to see?
A successful connection.
What did you see instead?
"remote error: tls: bad certificate" on the client and "tls: client didn't provide a certificate" on the server.
Workaround: set ServerName so that the config isn't cloned by tls.DialWithDialer.
(BTW, maybe it would be useful in unit tests to clone configs immediately before use.)
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version)?1.8 (this feature was introduced in 1.8)
What operating system and processor architecture are you using (
go env)?Linux (but it doesn't matter here)
What did you do?
Used tls.Dial (or tls.DialWithDialer) without setting ServerName in Config.
What did you expect to see?
A successful connection.
What did you see instead?
"remote error: tls: bad certificate" on the client and "tls: client didn't provide a certificate" on the server.
Workaround: set ServerName so that the config isn't cloned by tls.DialWithDialer.
(BTW, maybe it would be useful in unit tests to clone configs immediately before use.)