[Haskell-cafe] Debugging Wreq/http-client https requests
Michael Snoyman
michael at snoyman.com
Sat Nov 1 16:50:52 UTC 2014
We can certainly make this process more official/easier to use, but
http-client does support this. Manager has a field mTlsConnection which
specifies how to create a Connection value to a TLS server. Connection is a
relatively simple datatype that specifies what to do, e.g., when sending
data to a server. If you wanted to log all of that writes to a file, you
might do something like:
mOrig <- newManager tlsManagerSettings
let m = mOrig
{ mTlsConnection = \ha h p -> do
connOrig <- mTlsConnection mOrig ha h p
return connOrig { connectionWrite = \bs -> do
S.appendFile "/tmp/log" bs
connectionWrite connOrig bs
}
}
On Sat, Nov 1, 2014 at 1:16 AM, Cody Goodman <codygman.consulting at gmail.com>
wrote:
> I have a program that is POST'ing some data to a remote server.
> However, some part of the data I'm sending is wrong I believe.
>
> If this were plain http without encryption, wireshark would allow me
> to see the exact data being sent over the wire. However, with https it
> is encrypted.
>
> Is there an inbuilt way to debug requests sent by wreq or more likely,
> a way to output debug info for http-client?
>
> Alternatively, is there a way to use NSS support with either of these
> libraries:
>
>
> http://security.stackexchange.com/questions/35639/decrypting-tls-in-wireshark-when-using-dhe-rsa-ciphersuites
>
> Thanks in advance to all for your time.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141101/1841e0d7/attachment.html>
More information about the Haskell-Cafe
mailing list