from typing import Optional


def is_protocol_http2(protocol: Optional[str]) -> bool:
    """Checks whether the protocol is http2."""
    return protocol is not None and protocol.strip().upper() == 'HTTP2'