Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp Fix HTTPS through Proxy.



details:   https://anonhg.NetBSD.org/src/rev/37576163f4cd
branches:  trunk
changeset: 377230:37576163f4cd
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Jul 02 10:02:09 2023 +0000

description:
Fix HTTPS through Proxy.

While a regular HTTP Proxy, requires the absolute URL with protocol
and host part, yyou must only send the relative URL through a
CONNECT tunnel (you are talking to the target server).

diffstat:

 usr.bin/ftp/fetch.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 35da76a87f39 -r 37576163f4cd usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c       Sun Jul 02 09:40:25 2023 +0000
+++ b/usr.bin/ftp/fetch.c       Sun Jul 02 10:02:09 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fetch.c,v 1.236 2023/02/25 12:07:25 mlelstv Exp $      */
+/*     $NetBSD: fetch.c,v 1.237 2023/07/02 10:02:09 mlelstv Exp $      */
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.236 2023/02/25 12:07:25 mlelstv Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.237 2023/07/02 10:02:09 mlelstv Exp $");
 #endif /* not lint */
 
 /*
@@ -801,7 +801,12 @@ handle_proxy(const char *url, const char
        }
 
        FREEPTR(pui.path);
-       pui.path = ftp_strdup(url);
+#ifdef WITH_SSL
+       if (ui->utype == HTTPS_URL_T)
+               pui.path = ftp_strdup(ui->path);
+       else
+#endif
+               pui.path = ftp_strdup(url);
 
        freeurlinfo(ui);
        *ui = pui;



Home | Main Index | Thread Index | Old Index