]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_version_info: add CURL_VERSION_HTTPS_PROXY
authorOkhin Vasilij <OkhinVI@gmail.com>
Fri, 25 Nov 2016 09:27:22 +0000 (16:27 +0700)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 26 Nov 2016 16:28:53 +0000 (17:28 +0100)
Closes #1142

12 files changed:
configure.ac
docs/libcurl/curl_version_info.3
docs/libcurl/symbols-in-versions
include/curl/curl.h
lib/url.c
lib/version.c
lib/vtls/gskit.h
lib/vtls/gtls.h
lib/vtls/nssg.h
lib/vtls/openssl.h
lib/vtls/vtls.c
src/tool_help.c

index 5a8057f613e4340056ca3f6132a31c8b3df24e3f..7eff485b7f61884c7356bd952346183979f1a8df 100644 (file)
@@ -3710,6 +3710,11 @@ if test "x$USE_NGHTTP2" = "x1"; then
   SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
 fi
 
+if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
+    -o "x$NSS_ENABLED" = "x1"; then
+  SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
+fi
+
 AC_SUBST(SUPPORT_FEATURES)
 
 dnl For supported protocols in pkg-config file
index 5244c21b8287a62922d82dcbcfc4dab783a07d95..ebb11c33bf01d33a342f576e8b6a558b99be3beb 100644 (file)
@@ -153,6 +153,9 @@ libcurl was built with support for Unix domain sockets.
 libcurl was built with support for Mozilla's Public Suffix List. This makes
 libcurl ignore cookies with a domain that's on the list.
 (Added in 7.47.0)
+.IP CURL_VERSION_HTTPS_PROXY
+libcurl was built with support for HTTPS-proxy.
+(Added in 7.52.0)
 .RE
 \fIssl_version\fP is an ASCII string for the OpenSSL version used. If libcurl
 has no SSL support, this is NULL.
index c7cd5a8f3528636d6f0398b7c085a3cc83377fd1..3dbba86765374cf86e72bf9913e8118575606d80 100644 (file)
@@ -810,6 +810,7 @@ CURL_VERSION_DEBUG              7.10.6
 CURL_VERSION_GSSAPI             7.38.0
 CURL_VERSION_GSSNEGOTIATE       7.10.6        7.38.0
 CURL_VERSION_HTTP2              7.33.0
+CURL_VERSION_HTTPS_PROXY        7.52.0
 CURL_VERSION_IDN                7.12.0
 CURL_VERSION_IPV6               7.10
 CURL_VERSION_KERBEROS4          7.10          7.33.0
index c8b85069cb82db9e5a9ea265b0f175d8e89c753c..331bec6e2688e03c1b0be8b4a765672fd7d8038c 100644 (file)
@@ -640,7 +640,7 @@ typedef enum {
                            CONNECT HTTP/1.1 */
   CURLPROXY_HTTP_1_0 = 1,   /* added in 7.19.4, force to use CONNECT
                                HTTP/1.0  */
-  CURLPROXY_HTTPS = 2, /* added in TBD */
+  CURLPROXY_HTTPS = 2, /* added in 7.52.0 */
   CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
                            in 7.10 */
   CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
@@ -2446,6 +2446,7 @@ typedef struct {
 #define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
 #define CURL_VERSION_PSL          (1<<20) /* Mozilla's Public Suffix List, used
                                              for cookie domain verification */
+#define CURL_VERSION_HTTPS_PROXY  (1<<21) /* HTTPS-proxy support built-in */
 
  /*
  * NAME curl_version_info()
index 675d7ee57208eb2809bf79561354acfc64ebd4cd..c1c3a931b31f05a2244dd294612794b25c41a498 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -4924,6 +4924,14 @@ static CURLcode parse_proxy(struct Curl_easy *data,
   else
     proxyptr = proxy; /* No xxx:// head: It's a HTTP proxy */
 
+#ifndef HTTPS_PROXY_SUPPORT
+  if(proxytype == CURLPROXY_HTTPS) {
+    failf(data, "Unsupported proxy \'%s\'"
+                ", libcurl is built without the HTTPS-proxy support.", proxy);
+    return CURLE_NOT_BUILT_IN;
+  }
+#endif
+
   sockstype = proxytype == CURLPROXY_SOCKS5_HOSTNAME ||
               proxytype == CURLPROXY_SOCKS5 ||
               proxytype == CURLPROXY_SOCKS4A ||
index a434a6287ed1e0a83c4765b60e521a5f7e871715..3d17768131fbcdee0ec7a24c8b640cefd55d67d6 100644 (file)
@@ -323,6 +323,9 @@ static curl_version_info_data version_info = {
 #endif
 #if defined(USE_LIBPSL)
   | CURL_VERSION_PSL
+#endif
+#if defined(HTTPS_PROXY_SUPPORT)
+  | CURL_VERSION_HTTPS_PROXY
 #endif
   ,
   NULL, /* ssl_version */
index e258a29f1ab2e8d2219f133b8dd5234ab546e232..229759217a398c78172359c17d9c8b3c2dc655ba 100644 (file)
@@ -41,6 +41,9 @@ int Curl_gskit_shutdown(struct connectdata *conn, int sockindex);
 size_t Curl_gskit_version(char *buffer, size_t size);
 int Curl_gskit_check_cxn(struct connectdata *cxn);
 
+/* Support HTTPS-proxy */
+/* TODO: add '#define HTTPS_PROXY_SUPPORT 1' and fix test #1014 (if need) */
+
 /* Set the API backend definition to GSKit */
 #define CURL_SSL_BACKEND CURLSSLBACKEND_GSKIT
 
index e3d58531f4c1349dd4a5bd6478f2734402589e4f..65312017edc5f9e7f706739aac56724f684c9631 100644 (file)
@@ -57,6 +57,9 @@ void Curl_gtls_sha256sum(const unsigned char *tmp, /* input */
 
 bool Curl_gtls_cert_status_request(void);
 
+/* Support HTTPS-proxy */
+#define HTTPS_PROXY_SUPPORT 1
+
 /* Set the API backend definition to GnuTLS */
 #define CURL_SSL_BACKEND CURLSSLBACKEND_GNUTLS
 
index ac67e6ab73849259ced076671b056b3d291019eb..fd94003fb652693a69b2eff934cf0948711e5b28 100644 (file)
@@ -65,6 +65,9 @@ bool Curl_nss_cert_status_request(void);
 
 bool Curl_nss_false_start(void);
 
+/* Support HTTPS-proxy */
+#define HTTPS_PROXY_SUPPORT 1
+
 /* Set the API backend definition to NSS */
 #define CURL_SSL_BACKEND CURLSSLBACKEND_NSS
 
index ee18e710fc88866a35c14167df61fd3559f856ca..cff1e909cfbde75bbc5cf9f82ceef18505359539 100644 (file)
@@ -79,6 +79,9 @@ void Curl_ossl_sha256sum(const unsigned char *tmp, /* input */
 
 bool Curl_ossl_cert_status_request(void);
 
+/* Support HTTPS-proxy */
+#define HTTPS_PROXY_SUPPORT 1
+
 /* Set the API backend definition to OpenSSL */
 #define CURL_SSL_BACKEND CURLSSLBACKEND_OPENSSL
 
index e8fd3cf434fd8b6f18cea2ed18c1c7d39536a15f..b808e1c5fef807d06c95cd344f83bce92787a3b9 100644 (file)
@@ -187,8 +187,7 @@ ssl_connect_init_proxy(struct connectdata *conn, int sockindex)
   DEBUGASSERT(conn->bits.proxy_ssl_connected[sockindex]);
   if(ssl_connection_complete == conn->ssl[sockindex].state &&
      !conn->proxy_ssl[sockindex].use) {
-#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_NSS) ||  \
-  defined(USE_GSKIT)
+#if defined(HTTPS_PROXY_SUPPORT)
     conn->proxy_ssl[sockindex] = conn->ssl[sockindex];
     memset(&conn->ssl[sockindex], 0, sizeof(conn->ssl[sockindex]));
 #else
index 39a51784ae67c73d7aa857123791261e9acf9658..992a969ce9d6efdf1baee3b1d702b56d1690e992 100644 (file)
@@ -317,6 +317,7 @@ static const struct feat feats[] = {
   {"TLS-SRP",        CURL_VERSION_TLSAUTH_SRP},
   {"HTTP2",          CURL_VERSION_HTTP2},
   {"UnixSockets",    CURL_VERSION_UNIX_SOCKETS},
+  {"HTTPS-proxy",    CURL_VERSION_HTTPS_PROXY}
 };
 
 void tool_help(void)