From 0d8082116c171c6cba363dab80b506c9de629931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B8=B9=E5=86=B0?= Date: Mon, 4 May 2026 10:46:00 +0800 Subject: [PATCH] Potential fix for code scanning alert no. 5: Disabled TLS certificate check Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- znet/client.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/znet/client.go b/znet/client.go index edf7eb11..42acef6c 100644 --- a/znet/client.go +++ b/znet/client.go @@ -174,11 +174,8 @@ func (c *Client) Restart() { var err error if c.useTLS { // TLS encryption - config := &tls.Config{ - // Skip certificate verification here because the CA certificate of the certificate issuer is not authenticated - // (这里是跳过证书验证,因为证书签发机构的CA证书是不被认证的) - InsecureSkipVerify: true, - } + // Use default TLS verification (certificate chain + hostname verification enabled). + config := &tls.Config{} d := &tls.Dialer{ Config: config, }