Skip to content

Commit

Permalink
Remove unused TLS option (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikPelli authored Jan 13, 2025
1 parent 41d4edd commit 3e6a85f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ type ProxyCtx struct {
RoundTripper RoundTripper
// Specify a custom connection dialer that will be used only for the current
// request, including WebSocket connection upgrades
Dialer func(ctx context.Context, network string, addr string) (net.Conn, error)
InitializeTLS func(rawConn net.Conn, cfg *tls.Config) (net.Conn, error)
Dialer func(ctx context.Context, network string, addr string) (net.Conn, error)
// will contain the recent error that occurred while trying to send receive or parse traffic
Error error
// A handle for the user to keep data in the context, from the call of ReqHandler to the
Expand Down
5 changes: 1 addition & 4 deletions https.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,8 @@ func (proxy *ProxyHttpServer) initializeTLSconnection(
tlsConfig = c
}

if ctx.InitializeTLS != nil {
return ctx.InitializeTLS(targetConn, tlsConfig)
}
tlsConn := tls.Client(targetConn, tlsConfig)
if err := tlsConn.Handshake(); err != nil {
if err := tlsConn.HandshakeContext(ctx.Req.Context()); err != nil {
return nil, err
}
return tlsConn, nil
Expand Down

0 comments on commit 3e6a85f

Please sign in to comment.