Class TlsAlert

java.lang.Object
io.github.mahmoudimus.quic.tls.TlsAlert

public final class TlsAlert extends Object
The TLS alert descriptions (RFC 8446 section 6) the handshake raises. QUIC sends no TLS alerts: an alert becomes a CRYPTO_ERROR connection error, 0x0100 + alert (RFC 9001 section 4.8), built by QuicException.tlsAlert(int, String).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Access was denied (49).
    static final int
    A certificate was corrupt or failed a check such as its name (42).
    static final int
    An OCSP response was invalid (113).
    static final int
    A record failed to decrypt; not used by QUIC (20).
    static final int
    A certificate has expired or is not yet valid (45).
    static final int
    The server required a client certificate and none was sent (116).
    static final int
    A certificate was revoked (44).
    static final int
    Some other problem with a certificate made it unacceptable (46).
    static final int
    The sender will send no more data on the connection; TLS over TCP only (0).
    static final int
    A message could not be decoded (50).
    static final int
    A handshake cryptographic operation failed, such as a signature or Finished check (51).
    static final int
    The client offered ECH and the server did not accept it (121, RFC 9849 section 11.2).
    static final int
    No acceptable set of security parameters could be negotiated (40).
    static final int
    A field was out of range or inconsistent with other fields (47).
    static final int
    A downgrade was detected (86).
    static final int
    The peer's parameters are weaker than required (71).
    static final int
    An internal error unrelated to the peer (80).
    static final int
    A message lacked an extension it must carry (109).
    static final int
    No application protocol could be agreed with ALPN (120).
    static final int
    The peer's protocol version is recognized but not supported (70).
    static final int
    A record was longer than allowed; TLS over TCP only (22).
    static final int
    A message arrived out of order or where it is not allowed (10).
    static final int
    The certificate chain does not lead to a trusted certificate authority (48).
    static final int
    A PSK identity was not recognized (115).
    static final int
    The server does not recognize the server name the client asked for (112).
    static final int
    A certificate of an unsupported type (43).
    static final int
    A message carried an extension that was not offered or not allowed there (110).
    static final int
    The user cancelled the handshake (90).
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    fromErrorCode(long code)
    The alert a CRYPTO_ERROR code carries.
    static String
    name(int alert)
    The alert's name, as RFC 8446 spells it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CLOSE_NOTIFY

      public static final int CLOSE_NOTIFY
      The sender will send no more data on the connection; TLS over TCP only (0).
      See Also:
    • UNEXPECTED_MESSAGE

      public static final int UNEXPECTED_MESSAGE
      A message arrived out of order or where it is not allowed (10).
      See Also:
    • BAD_RECORD_MAC

      public static final int BAD_RECORD_MAC
      A record failed to decrypt; not used by QUIC (20).
      See Also:
    • RECORD_OVERFLOW

      public static final int RECORD_OVERFLOW
      A record was longer than allowed; TLS over TCP only (22).
      See Also:
    • HANDSHAKE_FAILURE

      public static final int HANDSHAKE_FAILURE
      No acceptable set of security parameters could be negotiated (40).
      See Also:
    • BAD_CERTIFICATE

      public static final int BAD_CERTIFICATE
      A certificate was corrupt or failed a check such as its name (42).
      See Also:
    • UNSUPPORTED_CERTIFICATE

      public static final int UNSUPPORTED_CERTIFICATE
      A certificate of an unsupported type (43).
      See Also:
    • CERTIFICATE_REVOKED

      public static final int CERTIFICATE_REVOKED
      A certificate was revoked (44).
      See Also:
    • CERTIFICATE_EXPIRED

      public static final int CERTIFICATE_EXPIRED
      A certificate has expired or is not yet valid (45).
      See Also:
    • CERTIFICATE_UNKNOWN

      public static final int CERTIFICATE_UNKNOWN
      Some other problem with a certificate made it unacceptable (46).
      See Also:
    • ILLEGAL_PARAMETER

      public static final int ILLEGAL_PARAMETER
      A field was out of range or inconsistent with other fields (47).
      See Also:
    • UNKNOWN_CA

      public static final int UNKNOWN_CA
      The certificate chain does not lead to a trusted certificate authority (48).
      See Also:
    • ACCESS_DENIED

      public static final int ACCESS_DENIED
      Access was denied (49).
      See Also:
    • DECODE_ERROR

      public static final int DECODE_ERROR
      A message could not be decoded (50).
      See Also:
    • DECRYPT_ERROR

      public static final int DECRYPT_ERROR
      A handshake cryptographic operation failed, such as a signature or Finished check (51).
      See Also:
    • PROTOCOL_VERSION

      public static final int PROTOCOL_VERSION
      The peer's protocol version is recognized but not supported (70).
      See Also:
    • INSUFFICIENT_SECURITY

      public static final int INSUFFICIENT_SECURITY
      The peer's parameters are weaker than required (71).
      See Also:
    • INTERNAL_ERROR

      public static final int INTERNAL_ERROR
      An internal error unrelated to the peer (80).
      See Also:
    • INAPPROPRIATE_FALLBACK

      public static final int INAPPROPRIATE_FALLBACK
      A downgrade was detected (86).
      See Also:
    • USER_CANCELED

      public static final int USER_CANCELED
      The user cancelled the handshake (90).
      See Also:
    • MISSING_EXTENSION

      public static final int MISSING_EXTENSION
      A message lacked an extension it must carry (109).
      See Also:
    • UNSUPPORTED_EXTENSION

      public static final int UNSUPPORTED_EXTENSION
      A message carried an extension that was not offered or not allowed there (110).
      See Also:
    • UNRECOGNIZED_NAME

      public static final int UNRECOGNIZED_NAME
      The server does not recognize the server name the client asked for (112).
      See Also:
    • BAD_CERTIFICATE_STATUS_RESPONSE

      public static final int BAD_CERTIFICATE_STATUS_RESPONSE
      An OCSP response was invalid (113).
      See Also:
    • UNKNOWN_PSK_IDENTITY

      public static final int UNKNOWN_PSK_IDENTITY
      A PSK identity was not recognized (115).
      See Also:
    • CERTIFICATE_REQUIRED

      public static final int CERTIFICATE_REQUIRED
      The server required a client certificate and none was sent (116).
      See Also:
    • NO_APPLICATION_PROTOCOL

      public static final int NO_APPLICATION_PROTOCOL
      No application protocol could be agreed with ALPN (120).
      See Also:
    • ECH_REQUIRED

      public static final int ECH_REQUIRED
      The client offered ECH and the server did not accept it (121, RFC 9849 section 11.2).
      See Also:
  • Method Details

    • name

      public static String name(int alert)
      The alert's name, as RFC 8446 spells it.
      Parameters:
      alert - the alert description
      Returns:
      the name, such as "handshake_failure", or "alert(N)" for an unknown one
    • fromErrorCode

      public static int fromErrorCode(long code)
      The alert a CRYPTO_ERROR code carries.
      Parameters:
      code - a QUIC transport error code
      Returns:
      the TLS alert description, or -1 if code is not in the CRYPTO_ERROR range