File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -91,16 +91,16 @@ func (l *Config) Clone() (cloned Config) {
91
91
}
92
92
93
93
func (l * Config ) connect (ldapAddr string ) (ldapConn * ldap.Conn , err error ) {
94
- tls := l .TLS
95
- if tls != nil && tls .ServerName == "" {
94
+ tlsConfig := l .TLS
95
+ if tlsConfig != nil && tlsConfig .ServerName == "" {
96
96
// Set the server name to the LDAP server address.
97
97
colonPos := strings .LastIndex (ldapAddr , ":" )
98
98
if colonPos == - 1 {
99
99
colonPos = len (ldapAddr )
100
100
}
101
101
host := ldapAddr [:colonPos ]
102
- tls = l .TLS .Clone ()
103
- tls .ServerName = host
102
+ tlsConfig = l .TLS .Clone ()
103
+ tlsConfig .ServerName = host
104
104
}
105
105
106
106
if l .ServerInsecure {
@@ -109,14 +109,14 @@ func (l *Config) connect(ldapAddr string) (ldapConn *ldap.Conn, err error) {
109
109
if l .ServerStartTLS {
110
110
ldapConn , err = ldap .Dial ("tcp" , ldapAddr )
111
111
} else {
112
- ldapConn , err = ldap .DialTLS ("tcp" , ldapAddr , tls )
112
+ ldapConn , err = ldap .DialTLS ("tcp" , ldapAddr , tlsConfig )
113
113
}
114
114
}
115
115
116
116
if ldapConn != nil {
117
117
ldapConn .SetTimeout (30 * time .Second ) // Change default timeout to 30 seconds.
118
118
if l .ServerStartTLS {
119
- err = ldapConn .StartTLS (tls )
119
+ err = ldapConn .StartTLS (tlsConfig )
120
120
}
121
121
}
122
122
You can’t perform that action at this time.
0 commit comments