From nobody@FreeBSD.org  Sat Jul 20 02:07:26 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id EB7BEE60
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 20 Jul 2013 02:07:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	by mx1.freebsd.org (Postfix) with ESMTP id DB43CC14
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 20 Jul 2013 02:07:26 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r6K27P5x020569
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 20 Jul 2013 02:07:25 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r6K27Pi9020562;
	Sat, 20 Jul 2013 02:07:25 GMT
	(envelope-from nobody)
Message-Id: <201307200207.r6K27Pi9020562@oldred.freebsd.org>
Date: Sat, 20 Jul 2013 02:07:25 GMT
From: "r4721@tormail.org" <r4721@tormail.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] fix libfetch incorrect location sent over https with http proxy 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         180666
>Category:       bin
>Synopsis:       [libfetch] [patch] fix libfetch incorrect location sent over https with http proxy
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 20 02:10:00 UTC 2013
>Closed-Date:    Thu Oct 10 09:44:24 UTC 2013
>Last-Modified:  Thu Oct 10 09:44:24 UTC 2013
>Originator:     r4721@tormail.org
>Release:        
>Organization:
>Environment:
>Description:
when using the new https over http proxy support, libfetch sends GET https://host/doc to host after connecting with CONNECT via the proxy. attached patch alters libfetch so it sends GET /doc instead.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: lib/libfetch/http.c
===================================================================
--- lib/libfetch/http.c	(revision 253282)
+++ lib/libfetch/http.c	(working copy)
@@ -1581,7 +1581,10 @@
 		if (verbose)
 			fetch_info("requesting %s://%s%s",
 			    url->scheme, host, url->doc);
-		if (purl) {
+		if (strcasecmp(url->scheme, SCHEME_HTTPS) == 0 && purl) {
+			http_cmd(conn, "%s %s HTTP/1.1",
+			    op, url->doc);
+		} else if (purl) {
 			http_cmd(conn, "%s %s://%s%s HTTP/1.1",
 			    op, url->scheme, host, url->doc);
 		} else {


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jul 20 03:24:56 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=180666 

From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To: freebsd-gnats-submit@freebsd.org 
Cc:  
Subject: Re: bin/180666: [libfetch] [patch] fix libfetch incorrect location sent over https with http proxy
Date: Sat, 20 Jul 2013 09:03:58 +0200

 How about this?
 
 Index: lib/libfetch/http.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 --- lib/libfetch/http.c	(revision 253469)
 +++ lib/libfetch/http.c	(working copy)
 @@ -1581,7 +1581,7 @@
  		if (verbose)
  			fetch_info("requesting %s://%s%s",
  			    url->scheme, host, url->doc);
 -		if (purl) {
 +		if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) !=3D 0) {
  			http_cmd(conn, "%s %s://%s%s HTTP/1.1",
  			    op, url->scheme, host, url->doc);
  		} else {
 
 DES
 --=20
 Dag-Erling Sm=C3=B8rgrav - des@des.no

From: r4721@tormail.org
To: bug-followup@freebsd.org
Cc: des@des.no
Subject: Re: bin/180666: [libfetch] [patch] fix libfetch incorrect location
 sent over https with http proxy
Date: Sat, 20 Jul 2013 11:46:47 +0000

 patch tested ok on http and https with and without proxy.
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/180666: commit references a PR
Date: Sun, 21 Jul 2013 07:00:05 +0000 (UTC)

 Author: des
 Date: Sun Jul 21 06:59:56 2013
 New Revision: 253514
 URL: http://svnweb.freebsd.org/changeset/base/253514
 
 Log:
   Use the correct request syntax for proxied (tunneled) HTTPS requests.
   
   PR:		bin/180666
   MFC after:	3 days
 
 Modified:
   head/lib/libfetch/http.c
 
 Modified: head/lib/libfetch/http.c
 ==============================================================================
 --- head/lib/libfetch/http.c	Sun Jul 21 05:23:34 2013	(r253513)
 +++ head/lib/libfetch/http.c	Sun Jul 21 06:59:56 2013	(r253514)
 @@ -1581,7 +1581,7 @@ http_request(struct url *URL, const char
  		if (verbose)
  			fetch_info("requesting %s://%s%s",
  			    url->scheme, host, url->doc);
 -		if (purl) {
 +		if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) {
  			http_cmd(conn, "%s %s://%s%s HTTP/1.1",
  			    op, url->scheme, host, url->doc);
  		} else {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: glebius 
State-Changed-When: Thu Oct 10 09:44:11 UTC 2013 
State-Changed-Why:  
Merged to stable/9. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=180666 
>Unformatted:
