[Haskell-cafe] Network.Curl and posting XML data

mf-hcafe-15c311f0c at etc-network.de mf-hcafe-15c311f0c at etc-network.de
Wed Oct 7 13:20:53 EDT 2009

I stand corrected.  The answer was 'cabal install HsOpenSSL'.

On Wed, Oct 07, 2009 at 09:37:38PM +1100, Erik de Castro Lopo wrote:
> To: haskell-cafe at haskell.org
> From: Erik de Castro Lopo <mle+hs at mega-nerd.com>
> Date: Wed, 7 Oct 2009 21:37:38 +1100
> Subject: Re: [Haskell-cafe] Network.Curl and posting XML data
> mf-hcafe-15c311f0c at etc-network.de wrote:
> > I am not aware of any SSL implementation in haskell either (even
> I really find this rather surprising. Ocaml has a very decent wrapper
> around Openssl that works rather well so it can't be that hard.

Does this mean something that has been done in Ocaml can't be tedious
and/or difficult?

I'm just saying that openssl has a very complex (and IMHO not very
efficient) API, and that I am not at all certain whether writing a
wrapper is better for your project than adding the functionality you
need to Crypto.  But I may be wrong.

> > though I think it should go not into HTTP but into Crypto (which is a
> > neat piece of code, but needs a lot more work)).
> But why shouldn't it should go into Network.HTTP? All I want to do
> is a HTTP POST of text/xml data to a HTTPS server and retrieve the
> text/xml data response and the HTTP response code. Whether that 
> URL is HTTP vs HTTPS shouldn't matter.
> With a sane API I should just be able to change from a HTTP url to 
> a HTTPS url and have it JustWork (tm). To have to use a different
> library depending on whether I'm doing http vs https is just
> horrible.

As Magnus has pointed out (thanks), that's not what I mean.  I am just
saying that hacking SSL into an HTTP library is wrong, since SSL is
something different.  For instance, it is also commonly used for POP,
IMAP, SMTP, and generic TCP tunneling.

> > I can think of two "quick" solutions if you need your Haskell code to
> > use an SSL link: run stunnel.org
> Sorry, thats way too cludgy for my application.
> > and make your application connect to
> > that, or write a Haskell wrapper around openssl.org.
> I've used openssl directly from C and C++ so  I know its doable, but
> I consider openssl a real blemish on the FOSS world.


> There is however this:
>    http://hackage.haskell.org/packages/archive/HsOpenSSL/0.6.5/doc/html/OpenSSL-Session.html

I really should look at hackage next time I am about to claim
something doesn't exist.  I just assumed you already had.  :)

Anyway, until somebody finds the time to put all these little related
libraries together, this is probably what you want to use.


More information about the Haskell-Cafe mailing list