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 Details

    • 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:
    • 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:
  • 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