'Wrap the socket for connecting over SSL.
:rtype: ssl.SSLSocket'

def _wrap_socket(self, sock):

    ssl_options = (self.params.ssl_options or {})
    return ssl.wrap_socket(sock, do_handshake_on_connect=self.DO_HANDSHAKE, **ssl_options)
