Bill St. Clair | 5 May 2010 04:41
Favicon

https through a proxy

I have an application where I need to do https requests through a proxy
server. It hangs in Drakma 1.1.0. I found the fix, for Lispworks only,
at
http://www.mail-archive.com/drakma-devel <at> common-lisp.net/msg00200.html .
I guess Edi didn't integrate it yet. I made it work in CCL 1.5, meaning
it will probably work everywhere, but I did't test Allegro. My fix is a
little ugly, as I'm setting a slot with no writer inside of the chunga
stream, but it works for me. Patch below.

-Bill St. Clair
wws <at> clozure.com

====

diff -rN old-drakma/request.lisp new-drakma/request.lisp
429c429,430
<     (let (http-stream must-close done)
---
>     (let ((proxying-https? (and proxy (not stream) (eq :https
(puri:uri-scheme uri))))
>            http-stream raw-http-stream must-close done)
437,438c438,440
<                   (use-ssl (or force-ssl
<                                (eq (uri-scheme uri) :https))))
---
>                    (use-ssl (and (not proxying-https?)
>                                  (or force-ssl
>                                      (eq (uri-scheme uri) :https)))))
470a473
>               (setq raw-http-stream http-stream)
(Continue reading)

Edi Weitz | 7 May 2010 21:43
Picon
Favicon

Re: https through a proxy

Hi Bill,

Thanks for the patch.  I can't really read it because your email
client broke it, but I think I get the idea.  Yes, I didn't integrate
the old patch and IIRC I didn't do it because it was a LW-only
solution.  Obviously, I don't like the new solution either because it
uses unexported symbols (and you can't change the underlying stream
for a reason).

As far as I understand, all this happens while the headers are still
sent and while chunking isn't really needed.  I haven't really thought
about the details, but maybe it would be possible to change the order
of how and when the streams are wrapped and use only exported
functionality.  In the worst case, one could "unwrap" the stream,
attach SSL, and then "rewrap" it.  Of course, the easiest solution
would be if CL+SSL and AllegroCL had something similar to LispWorks'
comm:attach-ssl.

Anyway, if someone wants to work on a "clean" solution to this
problem, I'll happily review it.  As usual:
http://weitz.de/patches.html

Thanks again,
Edi.

On Wed, May 5, 2010 at 4:41 AM, Bill St. Clair <wws <at> clozure.com> wrote:
> I have an application where I need to do https requests through a proxy
> server. It hangs in Drakma 1.1.0. I found the fix, for Lispworks only,
> at
> http://www.mail-archive.com/drakma-devel <at> common-lisp.net/msg00200.html .
(Continue reading)

Bill St. Clair | 9 May 2010 13:36
Favicon

Re: https through a proxy (Edi Weitz)

On 5/8/10 12:00PM, drakma-devel-request <at> common-lisp.net wrote:

> Date: Fri, 7 May 2010 21:43:17 +0200
> From: Edi Weitz <edi <at> agharta.de>
> Subject: Re: [drakma-devel] https through a proxy
> To: General interest list for Drakma and Chunga
> 	<drakma-devel <at> common-lisp.net>

> Thanks for the patch.  I can't really read it because your email
> client broke it, but I think I get the idea.  Yes, I didn't integrate
> the old patch and IIRC I didn't do it because it was a LW-only
> solution.  Obviously, I don't like the new solution either because it
> uses unexported symbols (and you can't change the underlying stream
> for a reason).
>
> As far as I understand, all this happens while the headers are still
> sent and while chunking isn't really needed.  I haven't really thought
> about the details, but maybe it would be possible to change the order
> of how and when the streams are wrapped and use only exported
> functionality.  In the worst case, one could "unwrap" the stream,
> attach SSL, and then "rewrap" it.  Of course, the easiest solution
> would be if CL+SSL and AllegroCL had something similar to LispWorks'
> comm:attach-ssl.
>
> Anyway, if someone wants to work on a "clean" solution to this
> problem, I'll happily review it.

I cleaned up my patch. It now contains no double-colons. It ends up
wrapping with the flexi-stream and chunking-stream twice in the https
through a proxy case, as not wrapping didn't work (it may work to wrap
(Continue reading)

Red Daly | 17 May 2010 12:27
Picon
Gravatar

Cookie-parsing patch for chunga

Cookies often have quoted-strings, as described in http://www.w3.org/Protocols/rfc2109/rfc2109 .  This patch adds quoted string support to the auxiliary cookie parsing functionality provided by Chunga.


*crossing my fingers that I formatted the patch properly*
- Red
_______________________________________________
drakma-devel mailing list
drakma-devel <at> common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
Edi Weitz | 19 May 2010 17:16
Picon
Favicon

New version 1.2.0

Available from http://weitz.de/ as usual.  ChangeLog below, thanks to
anyone who sent patches or bug reports.

Edi.

Version 1.2.0
2010-05-19
Introduced *REMOVE-DUPLICATE-COOKIES-P* (Ryan Davis)
Enabled https through a proxy (Bill St. Clair and Dave Lambert)
Bugfix for redirect of a request through a proxy (Bill St. Clair)
Export PARSE-COOKIE-DATE
Safer method to render URIs
Allowed for GET/POST parameters without a value (seen on Lotus webservers)
Edi Weitz | 19 May 2010 17:25
Picon
Favicon

New Chunga version 1.1.1

And, again on weitz.de, there's also a new release of Chunga.

Version 1.1.1
2010-05-19
Read quoted cookie values (Red Daly)
Zach Beane | 19 May 2010 20:36
Gravatar

Re: New version 1.2.0

Edi Weitz <edi <at> agharta.de> writes:

> Available from http://weitz.de/ as usual.  ChangeLog below, thanks to
> anyone who sent patches or bug reports.

This version does not compile for me; make-ssl-stream in util.lisp has
an extra paren at the end of line 334.

Zach
Edi Weitz | 19 May 2010 21:41
Picon
Favicon

New version 1.2.1

Yeah, sorry, I should have been more careful.  At least this was
reported by three persons in a couple of minutes which gives me the
warm and fuzzy feeling that there are enough users to catch
mistakes... :)

Thanks.  Bugfix release online.

Edi.

On Wed, May 19, 2010 at 8:36 PM, Zach Beane <xach <at> xach.com> wrote:
> Edi Weitz <edi <at> agharta.de> writes:
>
>> Available from http://weitz.de/ as usual.  ChangeLog below, thanks to
>> anyone who sent patches or bug reports.
>
> This version does not compile for me; make-ssl-stream in util.lisp has
> an extra paren at the end of line 334.
>
> Zach
>
>

Gmane