Skip to content

Commit

Permalink
fix: Fix Linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pizkaz committed Jun 5, 2024
1 parent b1d9468 commit aeeb5a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ func ldapDial() (conn *ldap.Conn, err error) {
if err != nil {
return
}
conn, err = ldap.DialTLS("tcp", addr, &tls.Config{InsecureSkipVerify: tls_no_verify})
conn, err = ldap.DialURL(fmt.Sprintf("ldaps://%s", addr), ldap.DialWithTLSConfig(&tls.Config{InsecureSkipVerify: tls_no_verify}))
if err != nil {
return
}

case "tls":
// STARTTLS
conn, err = ldap.Dial("tcp", addr)
conn, err = ldap.DialURL(fmt.Sprintf("ldap://%s", addr))
if err != nil {
return
}
Expand All @@ -47,7 +47,7 @@ func ldapDial() (conn *ldap.Conn, err error) {

default:
// No Encryption
conn, err = ldap.Dial("tcp", addr)
conn, err = ldap.DialURL(fmt.Sprintf("ldap://%s", addr))
}
if err != nil {
return
Expand Down

0 comments on commit aeeb5a6

Please sign in to comment.