make ldap cert check configurable, fix CodeQL warnings

This commit is contained in:
Christoph Haas
2021-03-22 22:52:08 +01:00
parent 588f8c7c70
commit 6ece6e5be9
3 changed files with 9 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ func Open(cfg *Config) (*ldap.Conn, error) {
if cfg.StartTLS {
// Reconnect with TLS
err = conn.StartTLS(&tls.Config{InsecureSkipVerify: true})
err = conn.StartTLS(&tls.Config{InsecureSkipVerify: !cfg.CertValidation})
if err != nil {
return nil, errors.Wrap(err, "failed to star TLS on connection")
}
@@ -92,7 +92,7 @@ func IsActiveDirectoryUserDisabled(userAccountControl string) bool {
return false
}
uacInt, err := strconv.Atoi(userAccountControl)
uacInt, err := strconv.ParseInt(userAccountControl, 10, 32)
if err != nil {
return true
}