Skip to content

Commit

Permalink
Set fallbackPort to 0 in SetTLSPortPolicy
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wneessen committed Oct 23, 2024
1 parent c5b5754 commit 3efd2b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3efd2b5

Please sign in to comment.