Extract the TLS session ticket from a SSL session object or raises IndexError if the ticket was not set.

def _extract_tls_session_ticket(ssl_session: nassl._nassl.SSL_SESSION) -> str:
        """Extract the TLS session ticket from a SSL session object or raises IndexError if the ticket was not set.
        """
        session_string = ((ssl_session.as_text()).split('TLS session ticket:'))[1]
        session_tls_ticket = (session_string.split('Compression:'))[0]
        return session_tls_ticket