Skip to content

feat: add new OkHTTP fingerprints #416

Open
barjin wants to merge 4 commits intoapify:masterfrom
yfe404:master
Open

feat: add new OkHTTP fingerprints #416
barjin wants to merge 4 commits intoapify:masterfrom
yfe404:master

Conversation

@barjin
Copy link
Member

@barjin barjin commented Mar 19, 2026

Adds profiles for emulating the fingerprints of the OkHTTP library (JVM / Android HTTP client).

Closes #411

yfe404 added 2 commits March 13, 2026 18:57
- Add okhttp3 preset: TLS 1.2 only, CBC/RSA cipher suites, 9 extensions
- Add okhttp5 preset: same TLS as okhttp4, different user-agent
- Wire impit's extension_order to rustls's contiguous_extensions for
  deterministic TLS extension ordering (fixes JA3 hash randomization)
- Restrict to TLS 1.2 when fingerprint has supported_versions: false
- Point rustls patch to yfe404/rustls fork with extension_order support
- Update Node.js and Python bindings with new browser variants
…order

feat: OkHttp 3/5 presets + deterministic TLS extension ordering
@barjin barjin assigned yfe404 and barjin and unassigned barjin Mar 19, 2026
Copy link
Member Author

@barjin barjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes @yfe404 !

I have few ideas regarding the changes, but only the Cargo.toml one is directly actionable. The rest are rather discussion points, feel free to treat them as such :)

Cargo.toml Outdated
[patch.crates-io]
h2 = { git = "https://github.com/apify/h2", rev = "7f393a728a8db07cabb1b78d2094772b33943b9a" }
rustls = { git = "https://github.com/apify/rustls", rev="4823cdb16098938eccf91af1329e9d5b681e3554" }
rustls = { git = "https://github.com/yfe404/rustls", rev="82b086057357e472ab2d519cff7be1f50b2d83e5" }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes have been merged to apify/rustls:impit-main, so this can be reverted

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted and pointing to the right commit

.iter()
.filter_map(|ext| {
match ext {
ExtensionType::ServerName => Some(RustlsExtType::ServerName),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary for now, but perhaps we could unify the enums somehow (use the rustls enum here?), so we don't have this duplicity. wdyt, does it make sense?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, the 1:1 mapping seem is redundant. Worth refactoring later imo

Comment on lines +179 to +181
} else {
rustls::ClientConfig::builder_with_provider(crypto_provider_arc)
.with_protocol_versions(&[&rustls::version::TLS12])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether we could somehow pass the tls13_enabled in here to keep the changes smaller (no big deal if not).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, would be cleaner, I add that to the commit below

yfe404 added 2 commits March 20, 2026 10:36
…lify TLS version branching

- Point rustls dependency back to apify/rustls at merged commit
- Wire supported_versions through to TlsExtensionsConfig so OkHttp 3's
  false value flows to rustls for extension suppression
- Collapse 3 ClientConfig branches into 2 by extracting protocol_versions
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.

feat: add OKHttp3 / 4 and other mobile fingerprints

3 participants