This commit is contained in:
@@ -105,14 +105,14 @@ func VerifyLdapCreds(username string, password string) bool {
|
||||
InsecureSkipVerify: true,
|
||||
}
|
||||
|
||||
// try connecting to AD via TLS and our custom certificate authority
|
||||
// Add port if not specified in .env file
|
||||
if strings.HasSuffix(ldapServer, ":636") {
|
||||
ldaps, err = ldap.DialTLS("tcp", ldapServer, tlsConfig)
|
||||
} else {
|
||||
ldaps, err = ldap.DialTLS("tcp", fmt.Sprintf("%s:636", ldapServer), tlsConfig)
|
||||
if !(strings.HasSuffix(ldapServer, ":636")) {
|
||||
ldapServer = fmt.Sprintf("%s:636", ldapServer)
|
||||
log.Printf("VerifyLdapCreds updated ldapServer string '%s'\n", ldapServer)
|
||||
}
|
||||
|
||||
// try connecting to AD via TLS and our custom certificate authority
|
||||
ldaps, err = ldap.DialTLS("tcp", ldapServer, tlsConfig)
|
||||
if err != nil {
|
||||
log.Printf("VerifyLdapCreds error connecting to LDAP bind address '%s' : '%s'\n", ldapServer, err)
|
||||
return false
|
||||
|
Reference in New Issue
Block a user