12 June 2012

Debugging SSL traffic with socat

Often when developing a client for a remote service using HTTPS (or any SSL-tunneled protocol) it difficult to dig into the data being transferred over the network. That is the case for me and here is another cheat sheet for me:

# socat -v TCP-LISTEN:443,reuseaddr,debug,fork OPENSSL:remote.host.com:443,verify=0

This sets up a SSL tunnel, accepting non-encrypted traffic from one side, encrypting it and passing to remote host.
Then you should use localhost:443 as a connection endpoint from your piece of software and watch all the traffic being sent :)
For detail on socat option take a look at documentation.
Post a Comment