Skip to content

Commit

Permalink
utls: even more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Snawoot committed Feb 24, 2024
1 parent d4e86ad commit 37401b3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plaintext.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (d *PlaintextDialer) DialContext(ctx context.Context, network, address stri
if d.hideSNI {
sni = ""
}
conn = tls.UClient(conn, &tls.Config{
tlsConn := tls.UClient(conn, &tls.Config{
ServerName: sni,
InsecureSkipVerify: true,
VerifyConnection: func(cs tls.ConnectionState) error {
Expand All @@ -62,7 +62,12 @@ func (d *PlaintextDialer) DialContext(ctx context.Context, network, address stri
_, err := cs.PeerCertificates[0].Verify(opts)
return err
},
}, tls.HelloRandomized)
}, tls.HelloAndroid_11_OkHttp)
if err := tlsConn.HandshakeContext(ctx); err != nil {
conn.Close()
return nil, err
}
return tlsConn, nil
}
return conn, nil
}
Expand Down

0 comments on commit 37401b3

Please sign in to comment.