Skip to content

Commit 3e6a85f

Browse files
authored
Remove unused TLS option (#625)
1 parent 41d4edd commit 3e6a85f

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

ctx.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ type ProxyCtx struct {
1818
RoundTripper RoundTripper
1919
// Specify a custom connection dialer that will be used only for the current
2020
// request, including WebSocket connection upgrades
21-
Dialer func(ctx context.Context, network string, addr string) (net.Conn, error)
22-
InitializeTLS func(rawConn net.Conn, cfg *tls.Config) (net.Conn, error)
21+
Dialer func(ctx context.Context, network string, addr string) (net.Conn, error)
2322
// will contain the recent error that occurred while trying to send receive or parse traffic
2423
Error error
2524
// A handle for the user to keep data in the context, from the call of ReqHandler to the

https.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,11 +662,8 @@ func (proxy *ProxyHttpServer) initializeTLSconnection(
662662
tlsConfig = c
663663
}
664664

665-
if ctx.InitializeTLS != nil {
666-
return ctx.InitializeTLS(targetConn, tlsConfig)
667-
}
668665
tlsConn := tls.Client(targetConn, tlsConfig)
669-
if err := tlsConn.Handshake(); err != nil {
666+
if err := tlsConn.HandshakeContext(ctx.Req.Context()); err != nil {
670667
return nil, err
671668
}
672669
return tlsConn, nil

0 commit comments

Comments
 (0)