diff --git a/internal/netxlite/netx.go b/internal/netxlite/netx.go index 96cd4a9dd4..23eb9be6e4 100644 --- a/internal/netxlite/netx.go +++ b/internal/netxlite/netx.go @@ -22,12 +22,6 @@ func (netx *Netx) maybeCustomUnderlyingNetwork() *MaybeCustomUnderlyingNetwork { return &MaybeCustomUnderlyingNetwork{netx.Underlying} } -// NewTLSHandshakerStdlib is like [netxlite.NewTLSHandshakerStdlib] but the constructed [model.TLSHandshaker] -// uses the [model.UnderlyingNetwork] configured inside the [Netx] structure. -func (n *Netx) NewTLSHandshakerStdlib(logger model.DebugLogger) model.TLSHandshaker { - return newTLSHandshakerLogger(&tlsHandshakerConfigurable{provider: n.maybeCustomUnderlyingNetwork()}, logger) -} - // NewHTTPTransportStdlib is like [netxlite.NewHTTPTransportStdlib] but the constructed [model.HTTPTransport] // uses the [model.UnderlyingNetwork] configured inside the [Netx] structure. func (n *Netx) NewHTTPTransportStdlib(logger model.DebugLogger) model.HTTPTransport { diff --git a/internal/netxlite/tls.go b/internal/netxlite/tls.go index a8ed747deb..7e31e2a8bd 100644 --- a/internal/netxlite/tls.go +++ b/internal/netxlite/tls.go @@ -163,8 +163,16 @@ var _ TLSConn = &tls.Conn{} // // 3. that we are going to use Mozilla CA if the [tls.Config] // RootCAs field is zero initialized. +func (netx *Netx) NewTLSHandshakerStdlib(logger model.DebugLogger) model.TLSHandshaker { + return newTLSHandshakerLogger( + &tlsHandshakerConfigurable{provider: netx.maybeCustomUnderlyingNetwork()}, logger) +} + +// NewTLSHandshakerStdlib is equivalent to creating an empty [*Netx] +// and calling its NewTLSHandshakerStdlib method. func NewTLSHandshakerStdlib(logger model.DebugLogger) model.TLSHandshaker { - return newTLSHandshakerLogger(&tlsHandshakerConfigurable{}, logger) + netx := &Netx{Underlying: nil} + return netx.NewTLSHandshakerStdlib(logger) } // newTLSHandshakerLogger creates a new tlsHandshakerLogger instance.