def default_ssl_context() -> ssl.SSLContext:
ctx = ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH)<EOL>ctx.options |= (ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1)<EOL>try:<EOL><INDENT>ctx.set_alpn_protocols(["<STR_LIT>", "<STR_LIT>"])<EOL><DEDENT>except NotImplementedError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>ctx.set_npn_protocols(["<STR_LIT>", "<STR_LIT>"])<EOL><DEDENT>except NotImplementedError:<EOL><INDENT>pass<EOL><DEDENT>return ctx<EOL>
Creates an SSL context suitable for use with HTTP/2. See
    https://tools.ietf.org/html/rfc7540#section-9.2 for what this entails.
    Specifically, we are interested in these points:

        § 9.2: Implementations of HTTP/2 MUST use TLS version 1.2 or higher.
        § 9.2.1: A deployment of HTTP/2 over TLS 1.2 MUST disable compression.

    The h2 project has its own ideas about how this context should be
    constructed but the resulting context doesn't work for us in the standard
    Python Docker images (though it does work under macOS). See
    https://python-hyper.org/projects/h2/en/stable/negotiating-http2.html#client-setup-example
    for more.