Repository: envoyproxy/envoy
File: api/envoy/extensions/filters/listener/tls_inspector/v3/tls_inspector.proto (Protocol Buffers)

Code before:

  // The size in bytes of the initial buffer requested by the tls_inspector.
  // If the filter needs to read additional bytes from the socket, the
  // filter will double the buffer up to it's default maximum of 16KiB.
  // If this size is not defined, defaults to maximum 16KiB that the
  // tls inspector will consume.
  google.protobuf.UInt32Value initial_read_buffer_size = 2
      [(validate.rules).uint32 = {lt: 65537 gt: 255}];

  // Close connection when TLS ClientHello message could not be parsed.
  // This flag should be enabled only if it is known that incoming connections are expected to use
  // TLS protocol, as Envoy does not distinguish between a plain text message or a malformed TLS
  // ClientHello message.
  // By default this flag is false and TLS ClientHello parsing errors are interpreted as a
  // plain text connection.
  // Setting this to true will cause connections to be terminated and the ``client_hello_too_large``
  // counter to be incremented if the ClientHello message is over implementation defined limit
  // (currently 16Kb).
  bool close_connection_on_client_hello_parsing_errors = 4;

  // The maximum size in bytes of the ClientHello that the tls_inspector will
  // process. If the ClientHello is larger than this size, the tls_inspector
  // will stop processing and indicate failure. If not defined, defaults to
  // 16KiB.
  google.protobuf.UInt32Value max_client_hello_size = 5
      [(validate.rules).uint32 = { lt: 65537 gt: 255 }];
}


Review comment (suggestion):
The max should be `SSL3_RT_MAX_PLAIN_LENGTH 16384`

Code after:
  google.protobuf.BoolValue enable_ja4_fingerprinting = 3;

  // The size in bytes of the initial buffer requested by the tls_inspector.
  // If the filter needs to read additional bytes from the socket, the
  // filter will double the buffer up to it's default maximum of 16KiB.
  // If this size is not defined, defaults to maximum 16KiB that the
  // tls inspector will consume.
  google.protobuf.UInt32Value initial_read_buffer_size = 2
      [(validate.rules).uint32 = {lt: 65537 gt: 255}];

  // Close connection when TLS ClientHello message could not be parsed.
  // This flag should be enabled only if it is known that incoming connections are expected to use
  // TLS protocol, as Envoy does not distinguish between a plain text message or a malformed TLS
  // ClientHello message.
  // By default this flag is false and TLS ClientHello parsing errors are interpreted as a
  // plain text connection.
  // Setting this to true will cause connections to be terminated and the ``client_hello_too_large``
  // counter to be incremented if the ClientHello message is over implementation defined limit
  // (currently 16Kb).
  bool close_connection_on_client_hello_parsing_errors = 4;

  // The maximum size in bytes of the ClientHello that the tls_inspector will
  // process. If the ClientHello is larger than this size, the tls_inspector
  // will stop processing and indicate failure. If not defined, defaults to
  // 16KiB.
  google.protobuf.UInt32Value max_client_hello_size = 5
      [(validate.rules).uint32 = {lte: 16384 gt: 255}];
}