Skip to content

SslStream indiscriminately uses ProtocolVersion TLS Alert for handshake failures #116305

Open
@rzikm

Description

@rzikm

Following code

else if (token.Failed && (_lastFrame.Header.Type == TlsContentType.Handshake || _lastFrame.Header.Type == TlsContentType.ChangeCipherSpec))
{
// If we failed without OS sending out alert, inject one here to be consistent across platforms.
payload = TlsFrameHelper.CreateAlertFrame(_lastFrame.Header.Version, TlsAlertDescription.ProtocolVersion);
}

will make sure we send out a TLS alert when handshake fails to complete, however, (at least on Windows), this leads to indiscriminately sending out ProtocolVersion alerts even for other cases of errors, such as when the two parties cannot communicate because they don't possess a common cipher/sigalg, or because an invalid message was received. This may be misleading when attempting to debug TLS handshake errors.

We should attempt to reply with an alert that most closely resembles the type of error encountered.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions