Skip to content

Commit

Permalink
Merge pull request #580 from Litrop/master
Browse files Browse the repository at this point in the history
Clone tlsCfg with ServerName because ServerName is needed by StartTLS
  • Loading branch information
foxcpp committed May 4, 2023
2 parents f5def9c + 6401870 commit 13a210f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/auth/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ func (a *Auth) newConn() (*ldap.Conn, error) {
return nil, fmt.Errorf("auth.ldap: invalid server URL: %w", err)
}
hostname := parsedURL.Host
a.tlsCfg.ServerName = strings.Split(hostname, ":")[0]
tlsCfg = a.tlsCfg.Clone()
a.tlsCfg.ServerName = hostname

conn, err = ldap.DialURL(u, ldap.DialWithDialer(a.dialer), ldap.DialWithTLSConfig(tlsCfg))
if err != nil {
Expand Down

0 comments on commit 13a210f

Please # to comment.