|
12 | 12 | resolve_ssl_version,
|
13 | 13 | )
|
14 | 14 |
|
15 |
| - |
| 15 | +# the minimum one may hope to negotiate with Python 3.7+ is tls1+ |
| 16 | +# anything else would be unsupported. |
16 | 17 | SSL_VERSION_ARG_MAPPING = {
|
| 18 | + 'tls1': 'PROTOCOL_TLSv1', |
| 19 | + 'tls1.1': 'PROTOCOL_TLSv1_1', |
17 | 20 | 'tls1.2': 'PROTOCOL_TLSv1_2',
|
18 | 21 | 'tls1.3': 'PROTOCOL_TLSv1_3',
|
19 | 22 | }
|
| 23 | +# todo: we'll need to update this in preparation for Python 3.13+ |
| 24 | +# could be a removal (after a long deprecation about constants |
| 25 | +# PROTOCOL_TLSv1, PROTOCOL_TLSv1_1, ...). |
20 | 26 | AVAILABLE_SSL_VERSION_ARG_MAPPING = {
|
21 | 27 | arg: getattr(ssl, constant_name)
|
22 | 28 | for arg, constant_name in SSL_VERSION_ARG_MAPPING.items()
|
|
27 | 33 | class QuicCapabilityCache(
|
28 | 34 | MutableMapping[Tuple[str, int], Optional[Tuple[str, int]]]
|
29 | 35 | ):
|
| 36 | + """This class will help us keep (persistent across runs) what hosts are QUIC capable. |
| 37 | + See https://urllib3future.readthedocs.io/en/latest/advanced-usage.html#remembering-http-3-over-quic-support for |
| 38 | + the implementation guide.""" |
30 | 39 |
|
31 | 40 | def __init__(self):
|
32 | 41 | self._cache = {}
|
@@ -77,6 +86,7 @@ def to_raw_cert(self):
|
77 | 86 | """Synthesize a requests-compatible (2-item tuple of cert and key file)
|
78 | 87 | object from HTTPie's internal representation of a certificate."""
|
79 | 88 | if self.key_password:
|
| 89 | + # Niquests support 3-tuple repr in addition to the 2-tuple repr |
80 | 90 | return self.cert_file, self.key_file, self.key_password
|
81 | 91 | return self.cert_file, self.key_file
|
82 | 92 |
|
|
0 commit comments