From 3efd2b529f5c2262e4442127e02c8d5a543a1e1c Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Wed, 23 Oct 2024 14:39:28 +0200 Subject: [PATCH] Set fallbackPort to 0 in SetTLSPortPolicy The default fallback port should be reset to 0 when setting the TLS port policy. This ensures the fallbackPort does not retain an incorrect value when switching policies. --- client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client.go b/client.go index 2e48358..f65766d 100644 --- a/client.go +++ b/client.go @@ -751,6 +751,7 @@ func (c *Client) SetTLSPolicy(policy TLSPolicy) { func (c *Client) SetTLSPortPolicy(policy TLSPolicy) { if c.port == DefaultPort { c.port = DefaultPortTLS + c.fallbackPort = 0 if policy == TLSOpportunistic { c.fallbackPort = DefaultPort