Skip to content

Commit 3efd2b5

Browse files
author
Winni Neessen
committed
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.
1 parent c5b5754 commit 3efd2b5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ func (c *Client) SetTLSPolicy(policy TLSPolicy) {
751751
func (c *Client) SetTLSPortPolicy(policy TLSPolicy) {
752752
if c.port == DefaultPort {
753753
c.port = DefaultPortTLS
754+
c.fallbackPort = 0
754755

755756
if policy == TLSOpportunistic {
756757
c.fallbackPort = DefaultPort

0 commit comments

Comments
 (0)