test again
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-04 12:23:08 +11:00
parent 2398288e08
commit 55f7bacd7b

View File

@@ -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