Skip to content

Commit

Permalink
ALPN enable/disable (#470)
Browse files Browse the repository at this point in the history
* ALPN enable/disable

* Remove weird breakline
  • Loading branch information
novitae authored Jan 8, 2025
1 parent b9be6b9 commit 8cfad55
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion curl_cffi/requests/impersonate.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,10 @@ def toggle_extension(curl, extension_id: int, enable: bool):
raise NotImplementedError("It's unlikely that the server_name(0) extension being changed.")
# ALPN
elif extension_id == 16:
raise NotImplementedError("It's unlikely that the ALPN(16) extension being changed.")
if enable:
curl.setopt(CurlOpt.SSL_ENABLE_ALPN, 1)
else:
curl.setopt(CurlOpt.SSL_ENABLE_ALPN, 0)
# status_request
elif extension_id == 5:
if enable:
Expand Down

0 comments on commit 8cfad55

Please sign in to comment.