Skip to content

Send random_tls_extension_order for custom TLS profiles - #170

Open
milkyontheblock wants to merge 1 commit into
FlorianREGAZ:mainfrom
milkyontheblock:fix/random-extension-order-custom-profile
Open

milkyontheblock wants to merge 1 commit into
FlorianREGAZ:mainfrom
milkyontheblock:fix/random-extension-order-custom-profile

Conversation

@milkyontheblock

Copy link
Copy Markdown

Problem

Session(client_identifier=None, ja3_string=..., random_tls_extension_order=True) has no effect. In execute_request, withRandomTLSExtensionOrder is only added to the payload in the else branch (preset profiles), so for a custom profile the option is silently dropped and the extension order is identical on every connection.

Fix

Add withRandomTLSExtensionOrder to the payload before the client_identifier is None branch, so it applies to both preset and custom profiles.

Verification

  • New unit test test_random_extension_order_is_sent_with_a_custom_profile: fails before the change, passes after.
  • Against https://tls.peet.ws/api/all with a custom JA3: before, the extension order was identical across sessions; after, it differs per session (6 different JA3 hashes in 6 runs) and the JA4 stays the same, as expected since JA4 sorts extensions.

withRandomTLSExtensionOrder was only added to the request payload in the
preset branch (client_identifier set). With client_identifier=None and a
ja3_string, the option was silently dropped, so the extension order stayed
fixed on every connection.

Send it for both branches and cover the custom profile with a test.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant