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
}
}