Skip to content

crypto/tls: add QUICEvent.Err #75108

Description

@neild

Proposal Details

This is an offshoot of discussion on #74922.

crypto/tls.QUICConn can report errors occurring during the TLS handshake in several places:

  1. QUICConn.Start returns an error if the handshake cannot be started.
  2. QUICConn.HandleData returns an error if processing data from the peer causes a handshake error.
  3. QUICConn.SendSessionTicket and QUICConn.StoreSession also return errors.

If errors can occur at points in the handshake other than during these functions, there is no way for QUICConn to report them.

The proposal is to add an additional way to report TLS errors. We add an Err field to QUICEvent, and produce an event with a type of QUICNoEvent and the Err field set when an error occurs:

type QUICEvent struct {
    // Set for QUICNoEvent
    Err error

    // existing fields as-is
}

const (
    // QUICNoEvent indicates that there are no events available.
    // QUICEvent.Err is set if the connection has encountered a fatal error.
    QUICNoEvent QUICEventKind = iota
)

An open question is what, if any, errors would be reported via this mechanism. It would be nice to have one concrete example of an error that we currently can't repor.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Accepted

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions