• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:enable +full:- +full:tls13

1 /* wget.c - Simple downloader to get the resource file from a HTTP server
7 * -------------------------------
8 * HTTP 1.1: https://www.rfc-editor.org/rfc/rfc7230
9 * Chunked Encoding: https://www.rfc-editor.org/rfc/rfc7230#section-4.1
10 * UTF-8 Encoded Header Values https://www.rfc-editor.org/rfc/rfc5987
13 * ---------
17 * TLS 1.0: https://tls-v1-0.badssl.com:1010/
18 * TLS 1.1: https://tls-v1-1.badssl.com:1011/
19 * TLS 1.2: https://tls-v1-2.badssl.com:1012/
20 * TLS 1.3: https://tls13.1d.pw/
29 USE_WGET(NEWTOY(wget, "<1>1(max-redirect)#<0=20d(debug)O(output-document):p(post-data):", TOYFLAG_U…
36 --max-redirect maximum redirections allowed
37 -d, --debug print lots of debugging information
38 -O, --output-document=FILE specify output filename
39 -p, --post-data=DATA send data in body of POST request
45 bool "Enable HTTPS support for wget via LibTLS"
49 Enable HTTPS support for wget by linking to LibTLS.
50 Supports using libtls, libretls or libtls-bearssl.
52 Use TOYBOX_LIBCRYPTO to enable HTTPS support via OpenSSL.
152 if (SSL_connect(TT.ssl) == -1) in wget_connect()
242 if (!TT.max_redirect--) error_exit("Too many redirects"); in wget_main()
246 if (TT.p) sprintf(toybuf, "Content-Length: %ld\r\n", (long)strlen(TT.p)); in wget_main()
247 ss = xmprintf("%s /%s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\n" in wget_main()
250 if (FLAG(d)) printf("--- Request\n%s", ss); in wget_main()
257 (len = wget_read(index, sizeof(toybuf)-(index-toybuf)))>0; index += len); in wget_main()
261 if (!(body = memmem(ss = toybuf, index-toybuf, "\r\n\r\n", 4))) in wget_main()
265 len = index-body; in wget_main()
266 if (FLAG(d)) printf("--- Response\n%s\n\n", toybuf); in wget_main()
279 if (TT.O && !strcmp(TT.O, "-")) fd = 1; in wget_main()
281 ss = wget_find_header(toybuf, "Content-Disposition: attachment; filename="); in wget_main()
284 for (ii = strlen(ss); ii; ii--) { in wget_main()
297 ss = (path && ss>path) ? xstrndup(path, ss-path) : 0; in wget_main()
310 chunked = wget_find_header(toybuf, "transfer-encoding: chunked"); in wget_main()
311 if (chunked) memmove(toybuf, body-2, len += 2); in wget_main()
321 c_len = c_len - len; in wget_main()
325 len = len - c_len; in wget_main()
339 c = memmem(toybuf + 2, len - 2, "\r\n",2); in wget_main()
343 len = len - (c - toybuf) - 2; in wget_main()
353 } while ((len += wget_read(toybuf + len, sizeof(toybuf) - len)) > 0); in wget_main()