-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from piercefreeman/feature/upgrade-utls
Upgrade `utls` to add support for ALPS
- Loading branch information
Showing
6 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
|
||
def install_ca(): | ||
run( | ||
run([ | ||
str(get_asset_path("grooveproxy")), | ||
"install-ca", | ||
) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
import pytest | ||
from playwright._impl._api_types import Error as PlaywrightError | ||
|
||
from groove.proxy import ProxyFailureError | ||
from groove.proxy import ProxyFailureError, Groove | ||
|
||
|
||
@pytest.mark.xfail(reason="TLS certificate blocked", raises=ProxyFailureError) | ||
def test_tls_addons(proxy, context): | ||
def test_tls_addons(proxy: Groove, context): | ||
""" | ||
Test TLS addons | ||
Test that our TLS payload has a field listing the installed signature extensions. We know | ||
that Google specifically checks for ALPS (ApplicationSettingsExtension) so we try to render | ||
the homepage here. | ||
""" | ||
page = context.new_page() | ||
|
||
proxy.tape_start() | ||
|
||
try: | ||
page.goto("https://www.google.com:443/") | ||
except PlaywrightError as e: | ||
if "net::ERR_EMPTY_RESPONSE" in e.message: | ||
raise ProxyFailureError() | ||
|
||
# Get the page | ||
tape_session = proxy.tape_get() | ||
|
||
assert len(tape_session.records) > 1 | ||
|
||
main_page = [ | ||
record | ||
for record in tape_session.records | ||
if record.request.url.strip("/") == "https://www.google.com:443" | ||
] | ||
|
||
assert len(main_page[0].response.body) > 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters