From de7a8e5061a88af705701b9b7c5a76013d0a9340 Mon Sep 17 00:00:00 2001 From: mmmray <142015632+mmmray@users.noreply.github.com> Date: Mon, 29 Apr 2024 18:28:50 +0200 Subject: [PATCH] do not crash if clientHello is nil --- tls.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tls.go b/tls.go index 5d39fae..d17750f 100644 --- a/tls.go +++ b/tls.go @@ -208,7 +208,7 @@ func Server(ctx context.Context, conn net.Conn, config *Config) (*Conn, error) { } mutex.Unlock() if hs.c.conn != conn { - if config.Show { + if config.Show && hs.clientHello != nil { fmt.Printf("REALITY remoteAddr: %v\tforwarded SNI: %v\n", remoteAddr, hs.clientHello.serverName) } io.Copy(target, underlying)