Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: crypto/tls: add DialWithConn(conn net.Conn, timeout time.Duration, addr string, config *Config) (*Conn, error) #31848

Open
runner-mei opened this issue May 6, 2019 · 1 comment

Comments

Projects
None yet
4 participants
@runner-mei
Copy link

commented May 6, 2019

I need build a tls conn on the windows namepipe, but DialWithDialer is insufflcient, becase net.Dialer isnot a interface, I cannot replace it with my Dialer.

similar, I run tls conn on other conn also, like serial port ...

@runner-mei runner-mei changed the title x/crypto/tls: Can add DialWithConn(conn net.Conn, timeout time.Duration, addr string, config *Config) (*Conn, error) { x/crypto/tls: Can add DialWithConn(conn net.Conn, timeout time.Duration, addr string, config *Config) (*Conn, error) May 6, 2019

@runner-mei runner-mei changed the title x/crypto/tls: Can add DialWithConn(conn net.Conn, timeout time.Duration, addr string, config *Config) (*Conn, error) crypto/tls: Can add DialWithConn(conn net.Conn, timeout time.Duration, addr string, config *Config) (*Conn, error) May 6, 2019

@andybons andybons changed the title crypto/tls: Can add DialWithConn(conn net.Conn, timeout time.Duration, addr string, config *Config) (*Conn, error) proposal: crypto/tls: add DialWithConn(conn net.Conn, timeout time.Duration, addr string, config *Config) (*Conn, error) May 8, 2019

@gopherbot gopherbot added this to the Proposal milestone May 8, 2019

@bronze1man

This comment has been minimized.

Copy link
Contributor

commented May 9, 2019

Here is a workaround:
From the source code of DialWithDialer https://golang.org/src/crypto/tls/tls.go?s=3677:3769#L98
You can write DialWithConn outside the package crypto/tls with tls.Client .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.