Skip to content

crypto/tls: DialWithDialer performs racy copy if config.ServerName is not set #16134

Description

@lmb

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions