aboutsummaryrefslogtreecommitdiffstats
path: root/libfetch
Commit message (Collapse)AuthorAgeFilesLines
* libfetch: fix no_proxy domain name comparisionTimo Teräs2020-04-011-1/+1
| | | | | | | | Fix comparing of the hostname portion that matches exactly. The no_proxy matching is pretty rudimentary though and probably could go through a bit of additional rework. Fixes #10681
* libfetch: fixups to packetization socket option settingTimo Teräs2020-03-251-26/+22
| | | | | | | | | | | - split the code to a helper function - do not set sockets to corked state when putting back to cache so socket state is always deterministic - cork/uncork also when sending CONNECT to a proxy, this can reduce a little bit the latency how fast the packet gets sent out - also pair corking with uncorking in http_request to make it more obvious pairing
* libfetch: minor HTTP handling improvementAlexander Wauck2020-03-251-5/+2
| | | | | | The recent TCP_CORK change missed this bit of code. This change should improve performance a bit when making HTTP requests by calling http_cmd only once instead of three times.
* libfetch: support TCP_CORKTimo Teräs2020-02-181-23/+22
| | | | | | | | | | | | | | | | | | | Unfortunately libfetch operates on raw sockets and is sending each HTTP request line using separate syscall which causes the HTTP request to be sent as multiple packets over the wire in most configurations. This is not good for performance, but can also cause subtle breakage if there's DPI firewall that does not get the Host header. Incidentally, it seems that on BSDs libfetch already sets TCP_NOPUSH optimize the packetization. This commit adds same logic for using TCP_CORK if available. When using TCP_CORK there is no requirement to set TCP_NODELAY as uncorking will also cause immediate send. Keep TCP_NODELAY in the fallback codepaths. Long term, it might make sense to replace or rewrite libfetch to use application level buffering.
* fix strncpy bounds errorsTimo Teräs2019-02-131-2/+2
| | | | | | error: 'strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation] Based on patch by Elan Ruusamäe <glen@delfi.ee>
* libfetch: do not give out user/hostname as ftp anonymous passwordTimo Teräs2018-09-051-15/+5
| | | | | | This is unwanted information disclosure. Reported-by: Max Justicz <max@justi.cz>
* libfetch: support OpenSSLA. Wilcox2018-01-311-1/+1
| | | | | TLS_client_method is a LibreSSL extension. SSLv23_client_method is generic, and doesn't mean SSL v2/v3 only.
* libfetch: add option to set "Cache-Control: no-cache"Timo Teräs2018-01-031-1/+4
| | | | ref #8161
* libfetch: honor https_proxy variable for httpsTimo Teräs2018-01-031-11/+30
| | | | fixes #8160
* libfetch: fix certificate host name checkTimo Teräs2017-10-061-1/+1
| | | | | OpenSSL allows passing zero-length to indicate "use strlen". LibreSSL requires using the real length always, so pass the length.
* libfetch: improve openssl/libressl compatibilityTimo Teräs2017-10-064-7/+436
| | | | | | X509_check_host() is introduced in libressl-2.5.0 and openssl-1.0.2 which are not yet universally available. Add support for building against the older versions.
* libfetch: improve ssl connectionsTimo Teräs2017-10-053-6/+111
| | | | | | | | | | | | loosely based on the freebsd implementation, implement https connection settings to override CA, and use client certificate. new files supported in /etc/apk/: ca.pem - if exists, it contains CAs acceptable for https (otherwise system wide CAs are used) crl.pem - if ca.pem is used, this is the (optional) CRL for it cert.pem - used as client authentication certificate (+ key) cert.key - used as client key (can be also inside cert.pem)
* libfetch: remove unwanted code conditionalsTimo Teräs2017-10-057-94/+7
|
* libfetch: fix ssl context leakTimo Teräs2017-10-051-0/+14
| | | | from freebsd
* build and use bundled libfetch nativelyTimo Teräs2017-10-056-100/+9
|
* import libfetch-2.38 from NetBSDTimo Teräs2017-10-0513-0/+6630
ftp://ftp.fu-berlin.de/unix/NetBSD/packages/current-src/pkgsrc/net/libfetch/files libfetch comes (at least) in netbsd and freebsd flavors which differing functionality. Alpine and Arch package netbsd one, but it's not widely packaged across other distributions. We need NetBSD version as it does not use funopen(3) which is not supported in musl, and supports connection pooling. FreeBSD seems to be the orignal and better maintained version with support for SSL CAs, client certificate authentication, proxy authentication, and improved http redirect handling. So this imports NetBSD version, and future commits will pick up the needed improvements from FreeBSD tree. Incidentally, this also fixes #7857 and likes for good.