ackwell / ninjabot

Ninjabot is not 'Just Another Bot'
10 stars 8 forks source link

Investigate why asyncio SSL support breaks #103

Open auscompgeek opened 9 years ago

auscompgeek commented 9 years ago

Following up from #76 and #102, it seems that asyncio's SSL support is slightly broken. We should figure out why.

From #102:

The behaviour when SSL/TLS is enabled is that a large chunk of messages are never received by the server.

/cc @gnustomp @cyphar

gnustomp commented 9 years ago

Clarifying "large chunk of messages": most messages aren't received. On occasion it might connect successfully, or it might not.

auscompgeek commented 8 years ago

It seems to work with Python 3.5.1. Perhaps it was just a Python 3.4 bug?

auscompgeek commented 8 years ago

Welp, I can reproduce with Ubuntu's Python 3.4.3. Time to hit the changelogs.

auscompgeek commented 8 years ago

Ok. It looks like Ubuntu 14.04's Python 3.4.3 still uses sslproto._create_transport_context() to create an SSL context, whereas upstream uses ssl.create_default_context() (introduced in issue 22641, previously used ssl._create_stdlib_context()).

tl;dr: fixed in the Python stdlib for both 3.4(.3) and 3.5, Ubuntu deliberately keeps buggy code.

gnustomp commented 8 years ago

Fedora's Python 3.4.3 also exhibits this behaviour. Python 3.5 seems to work.

auscompgeek commented 8 years ago

Wait, never mind. The code that Ubuntu has for that was backported upstream from 3.5, that code is actually current. I was looking in the wrong place.

auscompgeek commented 8 years ago

Python 3.5 from the deadsnakes PPA on Ubuntu 14.04 works fine.

gnustomp commented 8 years ago

Python 3.5 from mstuhcli's copr on Fedora 23 works fine. I think we can safely say this works in python 3.5.