Skip to content

Commit

Permalink
chore: Update appVersion to 1.2.1 in Chart.yaml and add TLS support f…
Browse files Browse the repository at this point in the history
…or LDAP connection
  • Loading branch information
aeltorio committed Sep 1, 2024
1 parent 83e1ff4 commit 5a86eb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helm/nginx-ad-auth/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ apiVersion: v2
name: nginx-ad-auth
description: A Helm chart for deploying nginx-ad-auth
version: 0.1.0
appVersion: "1.0.0"
appVersion: "1.2.1"
icon: https://avatars.githubusercontent.com/u/165936401?v=4
9 changes: 9 additions & 0 deletions nginx-ad-auth-go.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package main

import (
"crypto/tls"
_ "embed"
"flag"
"fmt"
Expand Down Expand Up @@ -161,8 +162,16 @@ func authenticateUser(username, password string) (bool, error) {
}
defer l.Close()

// Reconnect with TLS
err = l.StartTLS(&tls.Config{InsecureSkipVerify: true})
if err != nil {
// If the server does not support StartTLS, return an error
return false, fmt.Errorf("failed to start TLS: %w", err)
}

err = l.Bind(fmt.Sprintf("%s\\%s", adDomain, username), password)
if err != nil {
log.Printf("Failed to bind to LDAP: %v", err)
return false, nil
}

Expand Down

0 comments on commit 5a86eb8

Please sign in to comment.