(http_version)
| 827 | |
| 828 | |
| 829 | def _create_https_context(http_version): |
| 830 | # Function also used by urllib.request to be able to set the check_hostname |
| 831 | # attribute on a context object. |
| 832 | context = ssl._create_default_https_context() |
| 833 | # send ALPN extension to indicate HTTP/1.1 protocol |
| 834 | if http_version == 11: |
| 835 | context.set_alpn_protocols(['http/1.1']) |
| 836 | # enable PHA for TLS 1.3 connections if available |
| 837 | if context.post_handshake_auth is not None: |
| 838 | context.post_handshake_auth = True |
| 839 | return context |
| 840 | |
| 841 | |
| 842 | class HTTPConnection: |
no test coverage detected
searching dependent graphs…