MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / is_supported_version

Function is_supported_version

mitmproxy/net/tls.py:75–90  ·  view source on GitHub ↗
(version: Version)

Source from the content-addressed store, hash-verified

73
74@cache
75def 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
93EC_CURVES: dict[str, EllipticCurve] = {}

Callers

nothing calls this directly

Calls 1

recvMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…