Created
December 12, 2017 17:58
-
-
Save mocmocamoc/8544c288a486e95514fc982a7a0e8620 to your computer and use it in GitHub Desktop.
asyncio SSL handshake timeout patch
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
import asyncio | |
def checkHandshakeDone(self): | |
if self._in_handshake == True: | |
self._abort() | |
asyncio.sslproto.SSLProtocol.checkHandshakeDone = checkHandshakeDone | |
_start_handshake_orig = asyncio.sslproto.SSLProtocol._start_handshake | |
def _start_handshake(self): | |
_start_handshake_orig(self) | |
self._loop.call_later(10, self.checkHandshakeDone) | |
asyncio.sslproto.SSLProtocol._start_handshake = _start_handshake |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment