Skip to content
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

SSL Errors are not caught by proxy connector #2408

Closed
Insoleet opened this issue Oct 26, 2017 · 5 comments
Closed

SSL Errors are not caught by proxy connector #2408

Insoleet opened this issue Oct 26, 2017 · 5 comments
Labels

Comments

@Insoleet
Copy link
Contributor

Long story short

I'm running an application which can connects to many heterogeneous systems. Sometimes, SSL is badly done and verify fails.

When using a proxy connector, the exception is not catched by aiohttp. So my application, which is only waiting for standard aiohttp exception, fails to catch this one.

Expected behaviour

I expected the connector to catch this error so that it can throw an aiottp exception ClientSSLError, like the standard connector : https://github.com/aio-libs/aiohttp/blob/master/aiohttp/connector.py#L822

Actual behaviour

future: <Task finished coro=<NodeConnector.connect_peers() done, defined at sakia\data\connectors\node.py:278> exception=SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)')>

    ----
    Traceback (most recent call last):

  File "asyncio\tasks.py", line 242, in _step

  File "sakia\data\connectors\node.py", line 289, in connect_peers

  File "site-packages\aiohttp\client.py", line 692, in __aenter__

  File "site-packages\aiohttp\client.py", line 457, in _ws_connect

  File "site-packages\aiohttp\helpers.py", line 99, in __iter__

  File "site-packages\aiohttp\client.py", line 269, in _request

  File "site-packages\aiohttp\connector.py", line 392, in connect

  File "site-packages\aiohttp\connector.py", line 735, in _create_connection

  File "site-packages\aiohttp\connector.py", line 898, in _create_proxy_connection

  File "asyncio\base_events.py", line 802, in create_connection

  File "asyncio\base_events.py", line 828, in _create_connection_transport

  File "asyncio\futures.py", line 381, in __iter__

  File "asyncio\tasks.py", line 310, in _wakeup

  File "asyncio\futures.py", line 294, in result

  File "asyncio\sslproto.py", line 502, in data_received

  File "asyncio\sslproto.py", line 201, in feed_ssldata

  File "ssl.py", line 641, in do_handshake

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)

Steps to reproduce

Connect to a self-signed HTTPS website, throught a proxy.

Your environment

Windows 64 bits, python 3.5.

@asvetlov
Copy link
Member

@hellysmile please check.
I thought you've fixed it.

@Insoleet what aiohttp version do you use?

@Insoleet
Copy link
Contributor Author

I got this error on a build using aiohttp 2.3.1

@hellysmile
Copy link
Member

@Insoleet Hey, this is an issue, I'll do proposal for fix today

@asvetlov asvetlov changed the title SSL Errors are not catched in proxy connector SSL Errors are not caugth in proxy connector Oct 26, 2017
@asvetlov asvetlov changed the title SSL Errors are not caugth in proxy connector SSL Errors are not caught in proxy connector Oct 26, 2017
@asvetlov asvetlov changed the title SSL Errors are not caught in proxy connector SSL Errors are not caught by proxy connector Oct 26, 2017
@hellysmile
Copy link
Member

Fixed by #2446 in 2.3 branch, but it is not in master yet.

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants