DEBUG: client certificate at server

This commit is contained in:
Akash Mondal
2025-07-07 06:47:18 +00:00
committed by lla-dane
parent 0f64bb49b5
commit b3f0a4e8c4
6 changed files with 98 additions and 85 deletions

View File

@ -2,6 +2,8 @@ from collections.abc import (
Awaitable,
Callable,
)
from libp2p.transport.quic.connection import QUICConnection
from typing import cast
import logging
import sys
@ -281,6 +283,17 @@ class Swarm(Service, INetworkService):
) -> None:
raw_conn = RawConnection(read_write_closer, False)
# No need to upgrade QUIC Connection
if isinstance(self.transport, QUICTransport):
print("Connecting QUIC Connection")
quic_conn = cast(QUICConnection, raw_conn)
await self.add_conn(quic_conn)
# NOTE: This is a intentional barrier to prevent from the handler
# exiting and closing the connection.
await self.manager.wait_finished()
print("Connection Connected")
return
# Per, https://discuss.libp2p.io/t/multistream-security/130, we first
# secure the conn and then mux the conn
try:
@ -396,6 +409,7 @@ class Swarm(Service, INetworkService):
muxed_conn,
self,
)
print("add_conn called")
self.manager.run_task(muxed_conn.start)
await muxed_conn.event_started.wait()