Assuming you are running the node and using LND as an example in the lnd.conf file you can specify the TLS certificate used:
https://docs.lightning.engineering/lightning-network-tools/lnd/lnd.confNot perfect and you won't get everything but anything connecting to your node can then be read.
As a cheat, if you just want to see what is going on in general you can setup a bunch of nodes that just talk to each other and read all of their traffic.
-Dave
Hi Dave,
Thanks for your answer!
Checking the link you provided, I'm only able to see configuration for the TLS certificate on RPC connections.
I don't know if the node will use the same certificate, but I'm looking to read the p2p network messages (gossip protocol). I mean, the messages that are sent between the nodes.