code: def _setup_transport(self):
          
          if hasattr(self, 'sslopts'):
              self.sock = ssl.wrap_socket(self.sock, **self.sslopts)
          else:
              self.sock = ssl.wrap_socket(self.sock)
          self.sock.do_handshake()
          self._quick_recv = self.sock.read
docs: Wrap the socket in an SSL object.