New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use HTTPS proxy with aiohttp? #845
Comments
|
Currently there is no way to use HTTPS proxies. |
|
Thanks anyway :) |
|
Could someone shed some light on why HTTPS proxies are unsupported? I might be able to help out with a PR, but I want to understand whatever issue underlay this decision. |
|
Perhaps the main problem is that proxies are covered by mocked tests only. If you want work on it -- it would be awesome! |
|
We can write simple proxy, so we can use it for tests and as an example |
|
@fafhrd91 it is the best solution but who will do it? |
|
I think this task is low priority in general, also KeepSafe does not use any proxies. I am not with KeepSafe anymore, so I can not comment on payment. @danielnelson is responsible for KeepSafe backend |
|
#1366 did not work for me. I get a |
|
try |
|
@fafhrd91 thanks for the suggestion. I need to use a ProxyConnector object which doesn't expose access to the verify_ssl attribute of the BaseConnector. I tried setting the |
|
|
|
Thanks for your response @fafhrd91 . Trying again with latest zeep and aiohttp code. Here's my relevant aiohttp code: The ProxyAsyncTransport class looks like this: Am running into this Error:
If I comment out the line throwing that error in aiohhtp/client_regrep.py, I get:
|
|
Looks like I have it working. I needed to change my proxy url to be My working code looks like this: |
|
@mattharrison If I'm understanding correctly, your example code doesn't address this use case. This issue is about proxying over an HTTPS proxy connection. I.e. the proxy URL is itself an https - the connection between the client and the proxy is itself TLS/SSL-encrypted. Squid is an example of a proxy server with this feature. Changing the proxy URL so it becomes proxy-over-http isn't the same thing at all. All that said, IMO, proxying over HTTPS is ill-advised in almost all cases, and actually decreases security. When people want to use it, it is almost always a result of misunderstanding (not being aware of how CONNECT works to maintain security when proxying https over http proxy). Unfortunately, misunderstanding or not, there are business environments where proxy-over-https is required by policy. |
Here the comment for reference: aiohttp no works with HTTPS proxy, only HTTP. Ref aio-libs/aiohttp#845
* added support for http proxy Added support for http proxy. Tested and working: twint --search "twint" --since 2019-01-02 --proxy-type http --proxy-host 182.160.119.254 --proxy-port 56229 * added support for http proxy added support for http proxy. fix int to str cast. * Removed comment Here the comment for reference: aiohttp no works with HTTPS proxy, only HTTP. Ref aio-libs/aiohttp#845
* added support for http proxy Added support for http proxy. Tested and working: twint --search "twint" --since 2019-01-02 --proxy-type http --proxy-host 182.160.119.254 --proxy-port 56229 * added support for http proxy added support for http proxy. fix int to str cast. * Removed comment Here the comment for reference: aiohttp no works with HTTPS proxy, only HTTP. Ref aio-libs/aiohttp#845
* added support for http proxy Added support for http proxy. Tested and working: twint --search "twint" --since 2019-01-02 --proxy-type http --proxy-host 182.160.119.254 --proxy-port 56229 * added support for http proxy added support for http proxy. fix int to str cast. * Removed comment Here the comment for reference: aiohttp no works with HTTPS proxy, only HTTP. Ref aio-libs/aiohttp#845
I noticed the code in ProxyConnector:
assert proxy.startswith('http://'), ("Only http proxy supported", proxy)Is there any way to use HTTPS proxy with aiohttp?
If not, is this feature under consideration?
Any help will be appreciated.
The text was updated successfully, but these errors were encountered: