1
1
Fork 0
mirror of https://git.sr.ht/~emersion/tlstunnel synced 2024-04-28 08:55:00 +02:00

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

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 {