-
What is the correct way to implement private relay? I'm thinking about modifying quic or tls config, to check server and client certificates, but rustls::Server/ClientConfig are private in quic and tls. I can create a copy of libp2p-tls crate and add client\server cert validation, but it seems non-idiomatic. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I have found pnet module that does what I want for TCP. But how can I use pnet for quic?
|
Beta Was this translation helpful? Give feedback.
-
I encountered a similar issue and ended up forking A more supported approach would be to implement your own protocol and include it in Additionally, the concept of |
Beta Was this translation helpful? Give feedback.
-
Another option is to use https://github.com/libp2p/rust-libp2p/tree/master/misc/allow-block-list and just define which peers are allowed to connect to you. Or you implement your own connection management by implementing |
Beta Was this translation helpful? Give feedback.
I encountered a similar issue and ended up forking
libp2p-tls
to create my own certification validation mechanism. Upon examining the current implementations, I found that much of the connection handling focuses on ensuring that the other end islibp2p
based rather than based onmy-program
, which makes it difficult to reject connections from otherlibp2p
clients.A more supported approach would be to implement your own protocol and include it in
libp2p::identify
. Then, you can reject all clients (such as by immediately closing the connection) that do not support your defined protocol. You can use a method to encrypt your protocol string with the PSK, and then let the remote side decrypt t…