--
This commit is contained in:
@@ -23,20 +23,23 @@ async def probe_http3(host: str, port: int, sni: str | None, timeout: float = 6.
|
||||
|
||||
info = Http3Info()
|
||||
try:
|
||||
host_for_quic = sni or host
|
||||
configuration = QuicConfiguration(
|
||||
is_client=True,
|
||||
alpn_protocols=["h3", "h3-29"],
|
||||
verify_mode=None,
|
||||
server_name=host_for_quic,
|
||||
)
|
||||
try:
|
||||
import ssl as _ssl
|
||||
configuration.verify_mode = _ssl.CERT_NONE
|
||||
except Exception:
|
||||
pass
|
||||
host_for_quic = sni or host
|
||||
|
||||
async def _run():
|
||||
async with connect(host, port, configuration=configuration, server_name=host_for_quic) as client:
|
||||
# aioquic ≥ 0.9 dropped the `server_name` kwarg on connect(); SNI
|
||||
# is taken from QuicConfiguration.server_name instead.
|
||||
async with connect(host, port, configuration=configuration) as client:
|
||||
await client.wait_connected()
|
||||
return True
|
||||
ok = await asyncio.wait_for(_run(), timeout=timeout)
|
||||
|
||||
Reference in New Issue
Block a user