[Haskell-cafe] Debugging Wreq/http-client https requests

Cody Goodman codygman.consulting at gmail.com
Tue Nov 4 20:10:15 UTC 2014


Thanks for the example Michael, I ended up skipping cert checks but
it's nice to know how to override the tlsConnection like this.

On Sat, Nov 1, 2014 at 11:50 AM, Michael Snoyman <michael at snoyman.com> wrote:
> 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
>
>


More information about the Haskell-Cafe mailing list