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

2009-10-07 Thread mf-hcafe-15c311f0c


Hi Erik,

I am not aware of any SSL implementation in haskell either (even
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)).

I can think of two quick solutions if you need your Haskell code to
use an SSL link: run stunnel.org and make your application connect to
that, or write a Haskell wrapper around openssl.org.

As for the latter, I don't know your requirements and resources so
this may be possible, but from what i've seen of openssl i wouldn't
want to have to do that.

good luck,
matthias



On Wed, Oct 07, 2009 at 02:38:05PM +1100, Erik de Castro Lopo wrote:
 To: haskell-cafe@haskell.org
 From: Erik de Castro Lopo mle...@mega-nerd.com
 Date: Wed, 7 Oct 2009 14:38:05 +1100
 Subject: Re: [Haskell-cafe] Network.Curl and posting XML data
 
 Dmitry Olshansky wrote:
 
  Hi, Erik,
  
  Did you try Network.HTTP? Is it not enough?
 
 Apparently not.
 
 Now I need to do a post to a HTTPS server and Network.HTTP does
 not seem to support HTTPS. Is that really right?
 
 Erik
 -- 
 --
 Erik de Castro Lopo
 http://www.mega-nerd.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2009-10-07 Thread Erik de Castro Lopo
mf-hcafe-15c311...@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.
 
 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.

 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

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2009-10-07 Thread Magnus Therning
On Wed, Oct 7, 2009 at 11:37 AM, Erik de Castro Lopo
mle...@mega-nerd.com wrote:
 mf-hcafe-15c311...@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.

 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.

There is more to SSL than securing transport, as I'm sure you know,
arguably the functions that deal with HTTPS should be in Network.HTTP,
but all the crypto and cert handling (including verification/checking
of attributes of certs) should probably be housed somewhere else.

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
magnus@therning.org  Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter: magthe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2009-10-07 Thread mf-hcafe-15c311f0c

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@haskell.org
 From: Erik de Castro Lopo mle...@mega-nerd.com
 Date: Wed, 7 Oct 2009 21:37:38 +1100
 Subject: Re: [Haskell-cafe] Network.Curl and posting XML data
 
 mf-hcafe-15c311...@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.

agreed!


 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.


cheers,
Matthias
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2009-10-06 Thread Erik de Castro Lopo
Dmitry Olshansky wrote:

 Hi, Erik,
 
 Did you try Network.HTTP? Is it not enough?

Apparently not.

Now I need to do a post to a HTTPS server and Network.HTTP does
not seem to support HTTPS. Is that really right?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2009-08-11 Thread Erik de Castro Lopo
Hi all,

I need to do a HTTP post of XML data (Content-type == text/xml) to
a HTTP (eventually HTTPS) server and to retrieve both the response
code and some returned XML data.

I have had an extensive read of the haskell-curl docs:


http://hackage.haskell.org/packages/archive/curl/1.3.5/doc/html/Network-Curl.html

as well as playing around with some code, but haskell-curl doesn't
seem to support this. I've tried curlPost which along with not
returning a response also insists on encoding my XML data as
application/x-www-form-urlencoded which simply doesn't work.

Anyone ben able to get something like this to work? Are there any
alternatives to haskell-curl which will work for my application?

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2009-08-11 Thread Dmitry Olshansky
Hi, Erik,

Did you try Network.HTTP? Is it not enough?

2009/8/12 Erik de Castro Lopo mle...@mega-nerd.com mle%2...@mega-nerd.com


 Hi all,

 I need to do a HTTP post of XML data (Content-type == text/xml) to
 a HTTP (eventually HTTPS) server and to retrieve both the response
 code and some returned XML data.

 I have had an extensive read of the haskell-curl docs:


 http://hackage.haskell.org/packages/archive/curl/1.3.5/doc/html/Network-Curl.html

 as well as playing around with some code, but haskell-curl doesn't
 seem to support this. I've tried curlPost which along with not
 returning a response also insists on encoding my XML data as
 application/x-www-form-urlencoded which simply doesn't work.

 Anyone ben able to get something like this to work? Are there any
 alternatives to haskell-curl which will work for my application?

 Cheers,
 Erik
 --
 --
 Erik de Castro Lopo
 http://www.mega-nerd.com/
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2009-08-11 Thread Erik de Castro Lopo
Dmitry Olshansky wrote:

 Did you try Network.HTTP? Is it not enough?

I thought Network.HTTP was being deprecated and that Network.Curl was
supposed to replace it.

Network.HTTP certainly looks like it can do it.

Thanks,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2009-08-11 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote:

 I thought Network.HTTP was being deprecated and that Network.Curl was
 supposed to replace it.

Cale on IRC pointed out that Network.Curl does more than just HTTP
and that Network.HTTP allows more control than Network.Curl.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe