Skip to content

Commit

Permalink
dupclicate socket (#282)
Browse files Browse the repository at this point in the history
* dupclicate socket

* cleanup
  • Loading branch information
jettify authored Apr 22, 2018
1 parent 3c23879 commit ee119e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aiomysql/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ def _request_authentication(self):
if raw_sock is None:
raise RuntimeError("Transport does not expose socket instance")

raw_sock = raw_sock.dup()
self._writer.transport.close()
# MySQL expects TLS negotiation to happen in the middle of a
# TCP connection not at start. Passing in a socket to
# open_connection will cause it to negotiate TLS on an existing
Expand Down

0 comments on commit ee119e2

Please sign in to comment.