summaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-07-09 13:10:58 +0100
committerRon Yorston <rmy@pobox.com>2020-07-09 13:10:58 +0100
commit9c0b2f7020d7c30b21a930ef54be632e092e533b (patch)
treeb2187c40bd2fd9f49f73599fb08e52cb7a596de0 /networking/wget.c
parenta8c6e20e332a9e11a9d28cd6770eadb9c9d73cb7 (diff)
parentd21a63f9fca8eb16f79de9b72d4a3484dfaec1fc (diff)
downloadbusybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.gz
busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.bz2
busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/networking/wget.c b/networking/wget.c
index bc237c4a8..8a967fe20 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -679,7 +679,8 @@ static int spawn_https_helper_openssl(const char *host, unsigned port)
679 pid = xvfork(); 679 pid = xvfork();
680 if (pid == 0) { 680 if (pid == 0) {
681 /* Child */ 681 /* Child */
682 char *argv[9]; 682 char *argv[13];
683 char **argp;
683 684
684 close(sp[0]); 685 close(sp[0]);
685 xmove_fd(sp[1], 0); 686 xmove_fd(sp[1], 0);
@@ -702,13 +703,25 @@ static int spawn_https_helper_openssl(const char *host, unsigned port)
702 * TLS server_name (SNI) field are FQDNs (DNS hostnames). 703 * TLS server_name (SNI) field are FQDNs (DNS hostnames).
703 * IPv4 and IPv6 addresses, port numbers are not allowed. 704 * IPv4 and IPv6 addresses, port numbers are not allowed.
704 */ 705 */
706 argp = &argv[5];
705 if (!is_ip_address(servername)) { 707 if (!is_ip_address(servername)) {
706 argv[5] = (char*)"-servername"; 708 *argp++ = (char*)"-servername"; //[5]
707 argv[6] = (char*)servername; 709 *argp++ = (char*)servername; //[6]
708 } 710 }
709 if (!(option_mask32 & WGET_OPT_NO_CHECK_CERT)) { 711 if (!(option_mask32 & WGET_OPT_NO_CHECK_CERT)) {
710 argv[7] = (char*)"-verify_return_error"; 712 /* Abort on bad server certificate */
713 *argp++ = (char*)"-verify"; //[7]
714 *argp++ = (char*)"100"; //[8]
715 *argp++ = (char*)"-verify_return_error"; //[9]
716 if (!is_ip_address(servername)) {
717 *argp++ = (char*)"-verify_hostname"; //[10]
718 *argp++ = (char*)servername; //[11]
719 } else {
720 *argp++ = (char*)"-verify_ip"; //[10]
721 *argp++ = (char*)host; //[11]
722 }
711 } 723 }
724 //[12] (or earlier) is NULL terminator
712 725
713 BB_EXECVP(argv[0], argv); 726 BB_EXECVP(argv[0], argv);
714 xmove_fd(3, 2); 727 xmove_fd(3, 2);