Skip to content

Potential fix for code scanning alert no. 5: Disabled TLS certificate check#403

Open
aceld wants to merge 1 commit intomasterfrom
alert-autofix-5
Open

Potential fix for code scanning alert no. 5: Disabled TLS certificate check#403
aceld wants to merge 1 commit intomasterfrom
alert-autofix-5

Conversation

@aceld
Copy link
Copy Markdown
Owner

@aceld aceld commented May 4, 2026

Potential fix for https://github.com/aceld/zinx/security/code-scanning/5

To fix this without changing overall functionality (TLS connection still used via tls.Dialer), remove the insecure override and rely on Go’s default verification behavior.

Best fix in this snippet:

  • In znet/client.go, inside Client.Restart() where c.useTLS is handled, replace the tls.Config initialization that sets InsecureSkipVerify: true with an empty/default TLS config (&tls.Config{}).
  • Keep the existing dialer flow unchanged (tls.Dialer + DialContext), so behavior remains the same except certificate/hostname checks are now enforced.

No new methods or dependencies are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

… check

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@aceld aceld marked this pull request as ready for review May 4, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant