diff --git a/smtpd.go b/smtpd.go index 797ad8e..0dbf38c 100644 --- a/smtpd.go +++ b/smtpd.go @@ -119,6 +119,9 @@ func (srv *Server) newSession(c net.Conn) (s *session) { tlsConn, s.tls = c.(*tls.Conn) if s.tls { + // run handshake otherwise it's done when we first + // read/write and connection state will be invalid + tlsConn.Handshake() state := tlsConn.ConnectionState() s.peer.TLS = &state }