mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-11 15:40:54 +00:00
Supply local priv and pub key when upgrading to a secure transport
This commit is contained in:
@ -99,8 +99,11 @@ def initialize_default_swarm(
|
||||
# TODO parse muxer and sec to pass into TransportUpgrader
|
||||
muxer = muxer_opt or ["mplex/6.7.0"]
|
||||
private_key_bytes = private_key.export_key("DER")
|
||||
public_key_bytes = private_key.publickey().export_key("DER")
|
||||
security_transports_by_protocol = sec_opt or {
|
||||
TProtocol("insecure/1.0.0"): InsecureTransport(private_key_bytes)
|
||||
TProtocol("insecure/1.0.0"): InsecureTransport(
|
||||
private_key_bytes, public_key_bytes
|
||||
)
|
||||
}
|
||||
upgrader = TransportUpgrader(security_transports_by_protocol, muxer)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user