code: def get_request(self):
          
          # Accept the client
          client_socket, client_address = self.socket.accept()
  
          if ssl is not None and self.cert_file:
              # Setup an SSL context to accept clients with a certificate
              # signed by a known chain of authority.
              # Other clients will be rejected during handshake.
              context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
              try:
                  # Force a valid/signed client-side certificate
                  context.verify_mode = ssl.CERT_REQUIRED
  
                  # Load the server certificate
                  context.load_cert_chain(
                      certfile=self.cert_file,
                      keyfile=self.key_file,
                      password=self.key_password,
                  )
  
                  if self.ca_file:
                      # Load the given authority chain
                      context.load_verify_locations(self.ca_file)
                  else:
                      # Load the default chain if none given
                      context.load_default_certs(ssl.Purpose.CLIENT_AUTH)
              except Exception as ex:
                  # Explicitly log the error as the default behaviour hides it
                  _logger.error("Error setting up the SSL context: %s", ex)
                  raise
  
              try:
                  # SSL handshake
                  client_stream = context.wrap_socket(
                      client_socket, server_side=True
                  )
              except ssl.SSLError as ex:
                  # Explicitly log the exception before re-raising it
                  _logger.warning(
                      "Error during SSL handshake with %s: %s", client_address, ex
                  )
                  raise
          else:
              # Nothing to do, use the raw socket
              client_stream = client_socket
  
          return client_stream, client_address
docs: Accepts a new client. Sets up SSL wrapping if necessary.
  
          :return: A tuple: (client socket, client address tuple)