Module Name: src
Committed By: mlelstv
Date: Sun Jul 2 10:02:09 UTC 2023
Modified Files:
src/usr.bin/ftp: fetch.c
Log Message:
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).
To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/usr.bin/ftp/fetch.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.236 src/usr.bin/ftp/fetch.c:1.237
--- src/usr.bin/ftp/fetch.c:1.236 Sat Feb 25 12:07:25 2023
+++ src/usr.bin/ftp/fetch.c Sun Jul 2 10:02:09 2023
@@ -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;