aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2023-10-28 11:05:13 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-10-30 17:02:13 +0100
commitd2d48f21f3b0d4e4f7a77f73f95b30900d809ec8 (patch)
tree1cbe4ed8a63ef7ff10f86140b0ba2a3a94724e7d
parent225db9196a71a19132a4c334f256b59854afc70c (diff)
downloadcurl-d2d48f21f3b0d4e4f7a77f73f95b30900d809ec8.tar.gz
configure: better --disable-http
- disable HTTPS-proxy as well, since it can't work without HTTP - curl_setup: when HTTP is disabled, also disable all features that are HTTP-only - version: HTTPS-proxy only exists if HTTP support exists Closes #12223
-rw-r--r--configure.ac35
-rw-r--r--lib/curl_setup.h17
-rw-r--r--lib/version.c6
3 files changed, 44 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index a80748c10..6a8e81564 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4590,20 +4590,31 @@ if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
fi
+AC_MSG_CHECKING([if this build supports HTTPS-proxy])
dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
-if test "x$https_proxy" != "xno"; then
- if test "x$OPENSSL_ENABLED" = "x1" \
- -o "x$GNUTLS_ENABLED" = "x1" \
- -o "x$SECURETRANSPORT_ENABLED" = "x1" \
- -o "x$RUSTLS_ENABLED" = "x1" \
- -o "x$BEARSSL_ENABLED" = "x1" \
- -o "x$SCHANNEL_ENABLED" = "x1" \
- -o "x$GNUTLS_ENABLED" = "x1" \
- -o "x$MBEDTLS_ENABLED" = "x1"; then
- SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
- elif test "x$WOLFSSL_ENABLED" = "x1" -a "x$WOLFSSL_FULL_BIO" = "x1"; then
- SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
+if test "x$CURL_DISABLE_HTTP" != "x1"; then
+ if test "x$https_proxy" != "xno"; then
+ if test "x$OPENSSL_ENABLED" = "x1" \
+ -o "x$GNUTLS_ENABLED" = "x1" \
+ -o "x$SECURETRANSPORT_ENABLED" = "x1" \
+ -o "x$RUSTLS_ENABLED" = "x1" \
+ -o "x$BEARSSL_ENABLED" = "x1" \
+ -o "x$SCHANNEL_ENABLED" = "x1" \
+ -o "x$GNUTLS_ENABLED" = "x1" \
+ -o "x$MBEDTLS_ENABLED" = "x1"; then
+ SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
+ AC_MSG_RESULT([yes])
+ elif test "x$WOLFSSL_ENABLED" = "x1" -a "x$WOLFSSL_FULL_BIO" = "x1"; then
+ SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ else
+ AC_MSG_RESULT([no])
fi
+else
+ AC_MSG_RESULT([no])
fi
if test "x$ECH_ENABLED" = "x1"; then
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index fc462280f..de5b8040a 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -219,6 +219,23 @@
# define CURL_DISABLE_RTSP
#endif
+/*
+ * When HTTP is disabled, disable HTTP-only features
+ */
+
+#if defined(CURL_DISABLE_HTTP)
+# define CURL_DISABLE_ALTSVC 1
+# define CURL_DISABLE_COOKIES 1
+# define CURL_DISABLE_BASIC_AUTH 1
+# define CURL_DISABLE_BEARER_AUTH 1
+# define CURL_DISABLE_AWS 1
+# define CURL_DISABLE_DOH 1
+# define CURL_DISABLE_FORM_API 1
+# define CURL_DISABLE_HEADERS_API 1
+# define CURL_DISABLE_HSTS 1
+# define CURL_DISABLE_HTTP_AUTH 1
+#endif
+
/* ================================================================ */
/* No system header file shall be included in this file before this */
/* point. */
diff --git a/lib/version.c b/lib/version.c
index 47304259e..d1855313c 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -409,7 +409,8 @@ static int idn_present(curl_version_info_data *info)
#define idn_present NULL
#endif
-#if defined(USE_SSL) && !defined(CURL_DISABLE_PROXY)
+#if defined(USE_SSL) && !defined(CURL_DISABLE_PROXY) && \
+ !defined(CURL_DISABLE_HTTP)
static int https_proxy_present(curl_version_info_data *info)
{
(void) info;
@@ -460,7 +461,8 @@ static const struct feat features_table[] = {
#if defined(ENABLE_QUIC)
FEATURE("HTTP3", NULL, CURL_VERSION_HTTP3),
#endif
-#if defined(USE_SSL) && !defined(CURL_DISABLE_PROXY)
+#if defined(USE_SSL) && !defined(CURL_DISABLE_PROXY) && \
+ !defined(CURL_DISABLE_HTTP)
FEATURE("HTTPS-proxy", https_proxy_present, CURL_VERSION_HTTPS_PROXY),
#endif
#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN)