This commit is contained in:
@@ -55,7 +55,10 @@ func LoadLdapCert() {
|
|||||||
|
|
||||||
// only try to load certificate from file if the command line argument was specified
|
// only try to load certificate from file if the command line argument was specified
|
||||||
ldapCertFile := os.Getenv("LDAP_TRUST_CERT_FILE")
|
ldapCertFile := os.Getenv("LDAP_TRUST_CERT_FILE")
|
||||||
if ldapCertFile != "" {
|
if ldapCertFile == "" {
|
||||||
|
fmt.Printf("LoadLdapCert no certificate specified\n")
|
||||||
|
return
|
||||||
|
} else {
|
||||||
// Try to read the file
|
// Try to read the file
|
||||||
cf, err := os.ReadFile(GetFilePath(ldapCertFile))
|
cf, err := os.ReadFile(GetFilePath(ldapCertFile))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -121,6 +124,8 @@ func VerifyLdapCreds(username string, password string) bool {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("VerifyLdapCreds error binding to LDAP with supplied credentials : '%s'\n", err)
|
fmt.Printf("VerifyLdapCreds error binding to LDAP with supplied credentials : '%s'\n", err)
|
||||||
return false
|
return false
|
||||||
|
} else {
|
||||||
|
fmt.Printf("VerifyLdapCreds successfully bound to LDAP\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
searchReq := ldap.NewSearchRequest(
|
searchReq := ldap.NewSearchRequest(
|
||||||
|
Reference in New Issue
Block a user