You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using httptest.NewUnstartedServer, I'd expect tls.Config{GetCertificate: } to inject a cert if provided when invoking StartTLS()
What did you see happen?
Instead, StartTLS() injects a default TLS certificate if the config is empty of Certificate instances. You can see this directly here in the function itself
When providing a GetCertificate value, I'd expect ServeTLS to use the function provided when called. I think this should be possible by checking whether tls.Config has a value for GetCertificate (and injecting the default if not as well as the Certificates slice being empty)
The text was updated successfully, but these errors were encountered:
Go version
go version go1.23.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
When using
httptest.NewUnstartedServer
, I'd expecttls.Config{GetCertificate: }
to inject a cert if provided when invokingStartTLS()
What did you see happen?
Instead,
StartTLS()
injects a default TLS certificate if the config is empty ofCertificate
instances. You can see this directly here in the function itselfgo/src/net/http/httptest/server.go
Lines 167 to 169 in f9ce1dd
This is recreatable on Go playground 1.24.0
Output
https://go.dev/play/p/Zq1vaLxW6QH
What did you expect to see?
When providing a
GetCertificate
value, I'd expectServeTLS
to use the function provided when called. I think this should be possible by checking whethertls.Config
has a value forGetCertificate
(and injecting the default if not as well as theCertificates
slice being empty)The text was updated successfully, but these errors were encountered: