mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
DEBUG: client certificate at server
This commit is contained in:
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user