Ignore EOF on tls.Conn.Handshake

This happens when using the tls-alpn-01 challange.
This commit is contained in:
Simon Ser 2022-02-03 10:22:53 +01:00
parent 47f87cf2fc
commit 4bf50457dc
1 changed files with 3 additions and 1 deletions

View File

@ -288,7 +288,9 @@ func (ln *Listener) handle(conn net.Conn) error {
if err := tlsConn.SetDeadline(time.Now().Add(tlsHandshakeTimeout)); err != nil {
return fmt.Errorf("failed to set TLS handshake timeout: %v", err)
}
if err := tlsConn.Handshake(); err != nil {
if err := tlsConn.Handshake(); err == io.EOF {
return nil
} else if err != nil {
return fmt.Errorf("TLS handshake failed: %v", err)
}
if err := tlsConn.SetDeadline(time.Time{}); err != nil {