Support sni_hostname extension with SOCKS proxy.#774
Merged
lovelydinosaur merged 8 commits intoencode:masterfrom Sep 1, 2023
Merged
Support sni_hostname extension with SOCKS proxy.#774lovelydinosaur merged 8 commits intoencode:masterfrom
sni_hostname extension with SOCKS proxy.#774lovelydinosaur merged 8 commits intoencode:masterfrom
Conversation
Contributor
|
Great, Thanks. Let's also update the changelog. |
1 task
karpetrosyan
reviewed
Aug 9, 2023
Contributor
karpetrosyan
left a comment
There was a problem hiding this comment.
Unit tests should only test one specific thing and should ideally have only one assertion. I believe this test is overly complicated, so let us simplify it.
tests/_async/test_socks_proxy.py
Outdated
| extensions={"sni_hostname": "example.com"}, | ||
| ) as response: | ||
| info = [repr(c) for c in proxy.connections] | ||
| assert info == [ |
Contributor
There was a problem hiding this comment.
Let's remove this check
tests/_async/test_socks_proxy.py
Outdated
| assert response.status == 200 | ||
| assert response.content == b"Hello, world!" | ||
| info = [repr(c) for c in proxy.connections] | ||
| assert info == [ |
Contributor
|
Also, I'm not sure if this test actually checks whether sni_hostname works or not, so let's just remove it entirely. |
lovelydinosaur
approved these changes
Sep 1, 2023
karpetrosyan
approved these changes
Sep 1, 2023
Contributor
|
Thanks @Allgot. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The introduction of a new extension,
sni_hostname, allows users to define the hostname to be used during the TLS handshake. However, the update was applied inconsistently, leading to an incomplete extension. Currently, thesni_hostnameextension is not functioning when a SOCKS proxy is employed. This PR aims to address this gap and rectify the issue.Checklist
sni_hostnameextension with SOCKS proxy #773Closes #772