mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
* add a check for TLS connections.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
package pool
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
@ -16,6 +17,10 @@ func connCheck(conn net.Conn) error {
|
||||
// Reset previous timeout.
|
||||
_ = conn.SetDeadline(time.Time{})
|
||||
|
||||
// Check if tls.Conn.
|
||||
if c, ok := conn.(*tls.Conn); ok {
|
||||
conn = c.NetConn()
|
||||
}
|
||||
sysConn, ok := conn.(syscall.Conn)
|
||||
if !ok {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user