Perform one session resumption using Session IDs.

def _resume_with_session_id(
            self,
            server_info: ServerConnectivityInfo,
            ssl_version_to_use: OpenSslVersionEnum
    ) -> bool:
        """Perform one session resumption using Session IDs.
        """
        session1 = self._resume_ssl_session(server_info, ssl_version_to_use)
        try:
            # Recover the session ID
            session1_id = self._extract_session_id(session1)
        except IndexError:
            # Session ID not assigned
            return False

        if session1_id == '':
            # Session ID empty
            return False

        # Try to resume that SSL session
        session2 = self._resume_ssl_session(server_info, ssl_version_to_use, session1)
        try:
            # Recover the session ID
            session2_id = self._extract_session_id(session2)
        except IndexError:
            # Session ID not assigned
            return False

        # Finally, compare the two Session IDs
        if session1_id != session2_id:
            # Session ID assigned but not accepted
            return False

        return True