From cf575be678682b9e1aa02d3c8ec8f7b03874d1b0 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Thu, 21 Sep 2023 15:34:30 -0400 Subject: [PATCH] Fix unwrap tls conn --- proxy/proxy.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index f07af8c3..a14ddace 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -9,7 +9,6 @@ import ( "bytes" "context" "crypto/rand" - gotls "crypto/tls" "io" "math/big" "runtime" @@ -449,7 +448,7 @@ func UnwrapRawConn(conn net.Conn) (net.Conn, stats.Counter, stats.Counter) { readCounter = statConn.ReadCounter writerCounter = statConn.WriteCounter } - if xc, ok := conn.(*gotls.Conn); ok { + if xc, ok := conn.(*tls.Conn); ok { conn = xc.NetConn() } else if utlsConn, ok := conn.(*tls.UConn); ok { conn = utlsConn.NetConn()