Skip to content

Commit 5bd7ef5

Browse files
committed
refactor: simplify and refactor TLS function implementation
- Simplify the `WithTLS` function documentation - Remove setting the `ServerName` in the `WithTLS` function Signed-off-by: appleboy <[email protected]>
1 parent 61e5e01 commit 5bd7ef5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

options.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,13 @@ func WithSentinel(enable bool) Option {
5555
}
5656
}
5757

58-
// WithTLS is an option function that configures the Redis connection to use TLS.
59-
// It sets the ServerName to the address of the Redis server and enforces a minimum
60-
// TLS version of 1.2.
58+
// WithTLS returns an Option that configures the use of TLS for the connection.
59+
// It sets the minimum TLS version to TLS 1.2.
6160
func WithTLS() Option {
6261
return func(w *options) {
6362
w.tls = &tls.Config{
6463
MinVersion: tls.VersionTLS12,
6564
}
66-
if w.addr != "" {
67-
w.tls.ServerName = w.addr
68-
}
6965
}
7066
}
7167

0 commit comments

Comments
 (0)