code: def _ssl_wrap_socket(self, sock):
          
          context = self._parameters['ssl_options'].get('context')
          if context is not None:
              hostname = self._parameters['ssl_options'].get('server_hostname')
              return context.wrap_socket(
                  sock, do_handshake_on_connect=True,
                  server_hostname=hostname
              )
          if 'ssl_version' not in self._parameters['ssl_options']:
              self._parameters['ssl_options']['ssl_version'] = (
                  compatibility.DEFAULT_SSL_VERSION
              )
          return ssl.wrap_socket(
              sock, do_handshake_on_connect=True,
              **self._parameters['ssl_options']
          )
docs: Wrap SSLSocket around the Socket.
  
          :param socket.socket sock:
          :rtype: SSLSocket