diff --git a/conn_test.go b/conn_test.go index db7c2ab4..8ce94b3f 100644 --- a/conn_test.go +++ b/conn_test.go @@ -1575,10 +1575,10 @@ func TestServerCertificate(t *testing.T) { }() cli, err := Client(dtlsnet.PacketConnFromConn(ca), ca.RemoteAddr(), tt.clientCfg) + hserr := cli.Handshake() if err == nil { _ = cli.Close() } - hserr := cli.Handshake() if !tt.wantErr && (err != nil || hserr != nil) { t.Errorf("Client failed(%v, %v)", err, hserr) }