Class ProfileExtensions

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

public final class ProfileExtensions extends Object
The extensions browser profiles send, each as an ExtensionSpec whose body is encoded the way the browser encodes it (RFC 8446 section 4.2 and the extensions' own specifications). In the lists, GREASE stands for the hello's GREASE value of that list.
  • Field Details

    • GREASE

      public static final int GREASE
      In a cipher suite, group, version or signature scheme list: the hello's GREASE value.
      See Also:
    • APPLICATION_SETTINGS

      public static final int APPLICATION_SETTINGS
      application_settings (ALPS) with the codepoint Chrome has used since 2025.
      See Also:
    • TRUST_ANCHORS

      public static final int TRUST_ANCHORS
      trust_anchors (draft-ietf-tls-trust-anchor-ids).
      See Also:
    • ENCRYPTED_CLIENT_HELLO

      public static final int ENCRYPTED_CLIENT_HELLO
      encrypted_client_hello (RFC 9849).
      See Also:
    • QUIC_TRANSPORT_PARAMETERS

      public static final int QUIC_TRANSPORT_PARAMETERS
      quic_transport_parameters (RFC 9001 section 8.2).
      See Also:
    • RECORD_SIZE_LIMIT

      public static final int RECORD_SIZE_LIMIT
      record_size_limit (RFC 8449).
      See Also:
    • DELEGATED_CREDENTIALS

      public static final int DELEGATED_CREDENTIALS
      delegated_credentials (RFC 9345).
      See Also:
    • COMPRESS_CERTIFICATE

      public static final int COMPRESS_CERTIFICATE
      compress_certificate (RFC 8879).
      See Also:
    • X25519_MLKEM768

      public static final int X25519_MLKEM768
      The hybrid named group X25519MLKEM768 (draft-ietf-tls-ecdhe-mlkem).
      See Also:
    • ZLIB

      public static final int ZLIB
      Certificate compression algorithms (RFC 8879 section 7.3).
      See Also:
    • BROTLI

      public static final int BROTLI
      Certificate compression algorithms (RFC 8879 section 7.3).
      See Also:
    • ZSTD

      public static final int ZSTD
      Certificate compression algorithms (RFC 8879 section 7.3).
      See Also:
  • Method Details

    • greaseFirst

      public static ExtensionSpec greaseFirst()
      The first GREASE extension, with an empty body, as BoringSSL sends it.
    • greaseLast

      public static ExtensionSpec greaseLast()
      The last GREASE extension, with a one-byte body of zero, as BoringSSL sends it.
    • serverName

      public static ExtensionSpec serverName()
      server_name with the context's host name; left out when there is none.
    • extendedMasterSecret

      public static ExtensionSpec extendedMasterSecret()
      extended_master_secret (RFC 7627), empty.
    • renegotiationInfo

      public static ExtensionSpec renegotiationInfo()
      renegotiation_info (RFC 5746) of an initial handshake: an empty renegotiated_connection.
    • supportedGroups

      public static ExtensionSpec supportedGroups(int... groups)
      supported_groups: groups in order.
    • ecPointFormats

      public static ExtensionSpec ecPointFormats()
      ec_point_formats offering only the uncompressed format.
    • sessionTicket

      public static ExtensionSpec sessionTicket()
      session_ticket (RFC 5077), empty: no ticket to resume with.
    • sessionTicketUnlessResuming

      public static ExtensionSpec sessionTicketUnlessResuming()
      session_ticket (RFC 5077), empty, left out of a hello that resumes a TLS 1.3 session, as NSS (Firefox) leaves it out.
    • delegatedCredentials

      public static ExtensionSpec delegatedCredentials(int... schemes)
      delegated_credentials (RFC 9345) accepting credentials signed with schemes, in order.
    • recordSizeLimit

      public static ExtensionSpec recordSizeLimit(int limit)
      record_size_limit (RFC 8449) announcing limit.
    • alpn

      public static ExtensionSpec alpn()
      application_layer_protocol_negotiation with the context's protocols; left out when there are none.
    • statusRequest

      public static ExtensionSpec statusRequest()
      status_request for OCSP, with no responder ids and no extensions.
    • signatureAlgorithms

      public static ExtensionSpec signatureAlgorithms(int... schemes)
      signature_algorithms: schemes in order.
    • signedCertificateTimestamp

      public static ExtensionSpec signedCertificateTimestamp()
      signed_certificate_timestamp, empty.
    • keyShare

      public static ExtensionSpec keyShare(int... groups)
      key_share with a share for each of groups: the GREASE group's is one zero byte, the others are the context's public keys.
      Throws:
      IllegalArgumentException - from the body if the context has no key for a group
    • supplied

      public static ExtensionSpec supplied(int type)
      An extension whose body the connection makes itself (HelloContext.supplied()), such as QUIC's quic_transport_parameters; left out when the connection supplies none.
    • pskKeyExchangeModes

      public static ExtensionSpec pskKeyExchangeModes()
      psk_key_exchange_modes offering only psk_dhe_ke.
    • supportedVersions

      public static ExtensionSpec supportedVersions(int... versions)
      supported_versions: versions in order.
    • compressCertificate

      public static ExtensionSpec compressCertificate(int... algorithms)
      compress_certificate (RFC 8879) offering algorithms in order.
    • applicationSettings

      public static ExtensionSpec applicationSettings(String... protocols)
      application_settings (ALPS) for protocols, Chrome's codepoint.
    • trustAnchors

      public static ExtensionSpec trustAnchors(String... hexIds)
      trust_anchors naming hexIds, each a hex-encoded trust anchor ID.
    • greaseEch

      public static ExtensionSpec greaseEch(int... payloadLengths)
      A GREASE encrypted_client_hello (RFC 9849 section 6.2), as BoringSSL sends one when it has no ECHConfig: an outer ClientHello extension for HKDF-SHA256 and AES-128-GCM, a random config id, a random 32-byte enc and a random payload of one of payloadLengths.
    • nssGreaseEch

      public static ExtensionSpec nssGreaseEch()
      A GREASE encrypted_client_hello as NSS (Firefox) sends one when it has no ECHConfig (tls13_MaybeGreaseEch): an outer ClientHello extension for HKDF-SHA256 and, at random, AES-128-GCM or ChaCha20-Poly1305, a random config id and 32-byte enc, and a random payload as long as the ClientHelloInner NSS would have encrypted. That is the EncodedClientHelloInner made from this hello (tls13_ConstructInnerExtensionsFromOuter):
      • an inner encrypted_client_hello, the server_name, and supported_versions with TLS 1.3 alone;
      • the hello's other extensions that TLS 1.3 has, as one ech_outer_extensions;
      • the pre_shared_key, when resuming;
      padded as for a configuration whose maximum_name_length is 100 ( tls13_PadChInner), plus the 16-byte AEAD tag.