Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
crypto/tls: DialWithDialer performs racy copy if config.ServerName is not set #16134
tls.DialWithDialer copies the passed in tls.Config if Config.ServerName is not set, but does not exclude copying the unexported sync.Once: tls.go:138.
DialWithDialer should use something like cloneTLSClientConfig from net/http. Related to #15771, which proposes implementing a Clone method on Config, which would help here.
CC @GeoffreyPlouviez who found the bug originally.