Impersonate Chrome 110 (#148)

Add support for impersonating Chrome 110. Chrome 110 comes with TLS
extension permutation enabled by default. We mimic this behavior in libcurl with
the new CURLOPT_SSL_PERMUTE_EXTENSIONS option, which enables the
corresponding flag in BoringSSL.

---------

Co-authored-by: Johann Saunier <[email protected]>
This commit is contained in:
lwthiker
2023-02-25 11:29:14 +02:00
committed by GitHub
co-authored by Johann Saunier
parent b2b1ea0f8e
commit 9d05a81030
7 changed files with 367 additions and 56 deletions
+18 -1
View File
@@ -148,6 +148,7 @@ class TestImpersonation:
("curl_chrome101", None, None, "chrome_101.0.4951.67_win10"),
("curl_chrome104", None, None, "chrome_104.0.5112.81_win10"),
("curl_chrome107", None, None, "chrome_107.0.5304.107_win10"),
("curl_chrome110", None, None, "chrome_110.0.5481.177_win10"),
("curl_chrome99_android", None, None, "chrome_99.0.4844.73_android12-pixel6"),
("curl_edge99", None, None, "edge_99.0.1150.30_win10"),
("curl_edge101", None, None, "edge_101.0.1210.47_win10"),
@@ -203,6 +204,14 @@ class TestImpersonation:
"libcurl-impersonate-chrome",
"chrome_107.0.5304.107_win10"
),
(
"minicurl",
{
"CURL_IMPERSONATE": "chrome110"
},
"libcurl-impersonate-chrome",
"chrome_110.0.5481.177_win10"
),
(
"minicurl",
{
@@ -556,7 +565,15 @@ class TestImpersonation:
["tls_client_hello"]
)
equals, msg = sig.equals(expected_sig, reason=True)
allow_tls_permutation=browser_signatures[expected_signature] \
["signature"] \
.get("options", {}) \
.get("tls_permute_extensions", False)
equals, msg = sig.equals(
expected_sig,
allow_tls_permutation=allow_tls_permutation,
reason=True
)
assert equals, msg
@pytest.mark.asyncio