Skip to content

Commit

Permalink
server: stop logging TLS handshake errors in ErrorLog
Browse files Browse the repository at this point in the history
ErrorLog is meant for panic logging only. It should only be used
for logging server implementation bugs, not for logging client
runtime errors.
  • Loading branch information
emersion committed Nov 3, 2021
1 parent ee233dd commit 1285dc3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ func (c *Conn) handleStartTLS() {
tlsConn := tls.Server(c.conn, c.server.TLSConfig)

if err := tlsConn.Handshake(); err != nil {
c.server.ErrorLog.Printf("TLS handshake error for %s: %v", c.conn.RemoteAddr(), err)
c.WriteResponse(550, EnhancedCode{5, 0, 0}, "Handshake error")
return
}
Expand Down
1 change: 0 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ func (s *Server) handleConn(c *Conn) error {
c.conn.SetWriteDeadline(time.Now().Add(d))
}
if err := tlsConn.Handshake(); err != nil {
s.ErrorLog.Printf("TLS handshake error for %s: %v", tlsConn.RemoteAddr(), err)
return err
}
}
Expand Down

0 comments on commit 1285dc3

Please sign in to comment.