refactor(netx): extract tlsdialer from dialer
This commit is contained in:
parent
e0311e8fed
commit
704e5bd870
18 changed files with 699 additions and 494 deletions
|
|
@ -2,7 +2,6 @@ package dialer_test
|
|||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"io"
|
||||
"testing"
|
||||
|
|
@ -24,19 +23,3 @@ func TestLoggingDialerFailure(t *testing.T) {
|
|||
t.Fatal("expected nil conn here")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoggingTLSHandshakerFailure(t *testing.T) {
|
||||
h := dialer.LoggingTLSHandshaker{
|
||||
TLSHandshaker: dialer.EOFTLSHandshaker{},
|
||||
Logger: log.Log,
|
||||
}
|
||||
tlsconn, _, err := h.Handshake(context.Background(), dialer.EOFConn{}, &tls.Config{
|
||||
ServerName: "www.google.com",
|
||||
})
|
||||
if !errors.Is(err, io.EOF) {
|
||||
t.Fatal("not the error we expected")
|
||||
}
|
||||
if tlsconn != nil {
|
||||
t.Fatal("expected nil tlsconn here")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue