go-libp2p
go-libp2p copied to clipboard
noise: dump session keys for debugging
This is a long-term "nice to have" feature. It would be nice to be able to opt-in to dumping session keys to aid in debugging. Opting in shouldn't be possible to do by accident; a combination of a build-time flag and an environment variable is probably enough.
There's a really cool libp2p wireshark dissector that supports (a fork of) SECIO. It would be cool to extend that to support noise as well, but that would require a little work to make the session keys accessible to the dissector.
Not familiar with the Noise code at all, but TLS standard library uses the KeyLogWriter in the tls.Config.
This really only makes sense once there's a WireShark dissector for Noise, or some other way to decrypt the recorded traffic.