Skip to content

Commit

Permalink
explicit TLS handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinz01 committed Apr 30, 2024
1 parent fc125cd commit e821145
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,13 @@ func (s *LDAPServer) handleConnection(c net.Conn) {
TLSConfig: s.TLSConfig,
MessageCache: make(map[MessageID]any),
}
if _, isTLS := c.(*tls.Conn); isTLS {
if tlsConn, isTLS := c.(*tls.Conn); isTLS {
ldapConn.isTLS = true
err := tlsConn.Handshake()
if err != nil {
log.Println("TLS handshake error:", err)
return
}
}
for {
if ldapConn.closed {
Expand Down

0 comments on commit e821145

Please sign in to comment.