Class ClientHelloProfile

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

public final class ClientHelloProfile extends Object
What a client's ClientHello looks like:
  • its cipher suites, in order;
  • its extensions, in order, with how each body is made;
  • whether the extensions are shuffled per hello, as Chrome has done since version 110 (BoringSSL SSL_set_permute_extensions);
  • the length of its legacy_session_id.
A HelloContext supplies what changes per connection.
  • Constructor Details

    • ClientHelloProfile

      public ClientHelloProfile(String name, int[] cipherSuites, List<ExtensionSpec> extensions, boolean shuffleExtensions, int sessionIdLength)
      Parameters:
      name - the profile's name, such as chrome-156
      cipherSuites - the cipher suites in order, ProfileExtensions.GREASE for the hello's GREASE suite
      extensions - the extensions in order (the order they are shuffled from, if shuffled)
      shuffleExtensions - whether each hello permutes the extensions that are not fixed
      sessionIdLength - the length of the random legacy_session_id: 32 for a client in middlebox compatibility mode (RFC 8446 appendix D.4), 0 for none
  • Method Details

    • name

      public String name()
      Returns the profile's name.
      Returns:
      the profile's name
    • keyShareGroups

      public int[] keyShareGroups()
      The groups the profile's key_share carries real shares for, in order: the keys a client makes before encode(io.github.mahmoudimus.quic.tls.HelloContext).
      Returns:
      the group codes, without GREASE; empty if the profile sends no key shares
    • encode

      public byte[] encode(HelloContext context)
      The ClientHello handshake message for one connection: type, 24-bit length and body.
      Parameters:
      context - the connection's inputs
      Returns:
      the message