summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko2018-02-08 00:28:30 +0100
committerDenys Vlasenko2018-02-08 00:28:30 +0100
commit237a900bc5654c865298b33a70dee60e2cd05dbc (patch)
treea84dbf7146549059c11ffc45f29b48857af06284 /networking
parent47529d3f165c06bd0c3be751fdd4b743b4bddedb (diff)
downloadbusybox-237a900bc5654c865298b33a70dee60e2cd05dbc.zip
busybox-237a900bc5654c865298b33a70dee60e2cd05dbc.tar.gz
wget: do not ask for TLS-encrypted downloads on plain ftp:// URLs
function old new delta wget_main 2422 2431 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/wget.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 633dabb..95b88ad 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -807,11 +807,13 @@ static FILE* prepare_ftp_session(FILE **dfpp, struct host_info *target, len_and_
*dfpp = open_socket(lsa);
#if ENABLE_FEATURE_WGET_HTTPS
- /* "PROT P" enables encryption of data stream.
- * Without it (or with "PROT C"), data is sent unencrypted.
- */
- if (ftpcmd("PROT P", NULL, sfp) == 200)
- spawn_ssl_client(target->host, fileno(*dfpp), /*flags*/ 0);
+ if (target->protocol == P_FTPS) {
+ /* "PROT P" enables encryption of data stream.
+ * Without it (or with "PROT C"), data is sent unencrypted.
+ */
+ if (ftpcmd("PROT P", NULL, sfp) == 200)
+ spawn_ssl_client(target->host, fileno(*dfpp), /*flags*/ 0);
+ }
#endif
if (G.beg_range != 0) {