(version: Version)
| 73 | |
| 74 | @cache |
| 75 | def is_supported_version(version: Version): |
| 76 | client_ctx = SSL.Context(SSL.TLS_CLIENT_METHOD) |
| 77 | # Without SECLEVEL, recent OpenSSL versions forbid old TLS versions. |
| 78 | # https://github.com/pyca/cryptography/issues/9523 |
| 79 | client_ctx.set_cipher_list(b"@SECLEVEL=0:ALL") |
| 80 | client_ctx.set_min_proto_version(version.value) |
| 81 | client_ctx.set_max_proto_version(version.value) |
| 82 | client_conn = SSL.Connection(client_ctx) |
| 83 | client_conn.set_connect_state() |
| 84 | |
| 85 | try: |
| 86 | client_conn.recv(4096) |
| 87 | except SSL.WantReadError: |
| 88 | return True |
| 89 | except SSL.Error: |
| 90 | return False |
| 91 | |
| 92 | |
| 93 | EC_CURVES: dict[str, EllipticCurve] = {} |
nothing calls this directly
no test coverage detected
searching dependent graphs…