caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Simple HTTPS client example?
@ 2007-09-04  4:32 Dave Benjamin
  2007-09-04 12:07 ` [Caml-list] " Gerd Stolpmann
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Benjamin @ 2007-09-04  4:32 UTC (permalink / raw)
  To: caml-list

Has anyone written any code to use Ocamlnet to retrieve a URL using 
HTTPS? I'm looking at Uq_ssl and Http_client, but can't seem to find a 
way to fit them together.

Thanks,
Dave


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Simple HTTPS client example?
  2007-09-04  4:32 Simple HTTPS client example? Dave Benjamin
@ 2007-09-04 12:07 ` Gerd Stolpmann
  2007-09-04 16:18   ` Dave Benjamin
  0 siblings, 1 reply; 4+ messages in thread
From: Gerd Stolpmann @ 2007-09-04 12:07 UTC (permalink / raw)
  To: Dave Benjamin; +Cc: caml-list

Am Montag, den 03.09.2007, 21:32 -0700 schrieb Dave Benjamin:
> Has anyone written any code to use Ocamlnet to retrieve a URL using 
> HTTPS? I'm looking at Uq_ssl and Http_client, but can't seem to find a 
> way to fit them together.

There is no easy way to do so.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Simple HTTPS client example?
  2007-09-04 12:07 ` [Caml-list] " Gerd Stolpmann
@ 2007-09-04 16:18   ` Dave Benjamin
  2007-09-04 17:26     ` Gerd Stolpmann
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Benjamin @ 2007-09-04 16:18 UTC (permalink / raw)
  To: Gerd Stolpmann; +Cc: caml-list

Gerd Stolpmann wrote:
> Am Montag, den 03.09.2007, 21:32 -0700 schrieb Dave Benjamin:
>> Has anyone written any code to use Ocamlnet to retrieve a URL using 
>> HTTPS? I'm looking at Uq_ssl and Http_client, but can't seem to find a 
>> way to fit them together.
> 
> There is no easy way to do so.

Well, is there a difficult way to do so? Any idea what that way might be? =)

Otherwise, it seems like it ought to be possible at least to use a proxy 
like squid to relay the request. However, even with proxy enabled, I get 
this error:

	Exception: Failure "Http_client: bad URL".

whenever there is an "https" as the protocol. It looks like subclassing 
the call class and overriding set_request_uri to accept HTTPS URLs would 
at least make that error go away, but then something additional would 
need to be done to keep track of the protocol when it's time to send it 
to the proxy...

Thanks,
Dave


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Simple HTTPS client example?
  2007-09-04 16:18   ` Dave Benjamin
@ 2007-09-04 17:26     ` Gerd Stolpmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Stolpmann @ 2007-09-04 17:26 UTC (permalink / raw)
  To: Dave Benjamin; +Cc: caml-list

Am Dienstag, den 04.09.2007, 09:18 -0700 schrieb Dave Benjamin:
> Gerd Stolpmann wrote:
> > Am Montag, den 03.09.2007, 21:32 -0700 schrieb Dave Benjamin:
> >> Has anyone written any code to use Ocamlnet to retrieve a URL using 
> >> HTTPS? I'm looking at Uq_ssl and Http_client, but can't seem to find a 
> >> way to fit them together.
> > 
> > There is no easy way to do so.
> 
> Well, is there a difficult way to do so? Any idea what that way might be? =)

Yes. Change Http_client so it can make use of Uq_ssl. This is, however,
not so easy.

> Otherwise, it seems like it ought to be possible at least to use a proxy 
> like squid to relay the request. However, even with proxy enabled, I get 

A proxy doesn't work here, because encryption is end-to-end. What you
need is a tunnel endpoint like stunnel. I think that a few changes of
Http_client are still necessary since there is currently no way to
inject an already connected socket into it.

> this error:
> 
> 	Exception: Failure "Http_client: bad URL".
> 
> whenever there is an "https" as the protocol. It looks like subclassing 
> the call class and overriding set_request_uri to accept HTTPS URLs would 
> at least make that error go away, but then something additional would 
> need to be done to keep track of the protocol when it's time to send it 
> to the proxy...

I guess this is the simplest part of the change.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-04 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-04  4:32 Simple HTTPS client example? Dave Benjamin
2007-09-04 12:07 ` [Caml-list] " Gerd Stolpmann
2007-09-04 16:18   ` Dave Benjamin
2007-09-04 17:26     ` Gerd Stolpmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).