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