That will allow us to choose the SSL backend at runtime.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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;
- }
+#ifdef USE_SSL
+ if(!Curl_ssl->support_https_proxy)
#endif
+ if(proxytype == CURLPROXY_HTTPS) {
+ failf(data, "Unsupported proxy \'%s\', libcurl is built without the "
+ "HTTPS-proxy support.", proxy);
+ return CURLE_NOT_BUILT_IN;
+ }
sockstype = proxytype == CURLPROXY_SOCKS5_HOSTNAME ||
proxytype == CURLPROXY_SOCKS5 ||
#endif
#if defined(USE_LIBPSL)
| CURL_VERSION_PSL
-#endif
-#if defined(HTTPS_PROXY_SUPPORT)
- | CURL_VERSION_HTTPS_PROXY
#endif
,
NULL, /* ssl_version */
#ifdef USE_SSL
Curl_ssl_version(ssl_buffer, sizeof(ssl_buffer));
version_info.ssl_version = ssl_buffer;
+ if(Curl_ssl->support_https_proxy)
+ version_info.features |= CURL_VERSION_HTTPS_PROXY;
+ else
+ version_info.features &= ~CURL_VERSION_HTTPS_PROXY;
#endif
#ifdef HAVE_LIBZ
0, /* have_certinfo */
0, /* have_pinnedpubkey */
0, /* have_ssl_ctx */
+ 0, /* support_https_proxy */
Curl_axtls_init, /* init */
Curl_axtls_cleanup, /* cleanup */
0, /* have_pinnedpubkey */
#endif
1, /* have_ssl_ctx */
+ 0, /* support_https_proxy */
Curl_cyassl_init, /* init */
Curl_none_cleanup, /* cleanup */
0, /* have_pinnedpubkey */
#endif /* DARWIN_SSL_PINNEDPUBKEY */
0, /* have_ssl_ctx */
+ 0, /* support_https_proxy */
Curl_none_init, /* init */
Curl_none_cleanup, /* cleanup */
1, /* have_certinfo */
0, /* have_pinnedpubkey */
0, /* have_ssl_ctx */
+ /* TODO: convert to 1 and fix test #1014 (if need) */
+ 0, /* support_https_proxy */
+
Curl_gskit_init, /* init */
Curl_gskit_cleanup, /* cleanup */
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) */
-
extern const struct Curl_ssl Curl_ssl_gskit;
/* Set the API backend definition to GSKit */
1, /* have_certinfo */
1, /* have_pinnedpubkey */
0, /* have_ssl_ctx */
+ 1, /* support_https_proxy */
Curl_gtls_init, /* init */
Curl_gtls_cleanup, /* cleanup */
bool Curl_gtls_cert_status_request(void);
-/* Support HTTPS-proxy */
-#define HTTPS_PROXY_SUPPORT 1
-
extern const struct Curl_ssl Curl_ssl_gnutls;
/* Set the API backend definition to GnuTLS */
0, /* have_certinfo */
1, /* have_pinnedpubkey */
1, /* have_ssl_ctx */
+ 0, /* support_https_proxy */
Curl_mbedtls_init, /* init */
Curl_mbedtls_cleanup, /* cleanup */
1, /* have_certinfo */
1, /* have_pinnedpubkey */
0, /* have_ssl_ctx */
+ 1, /* support_https_proxy */
Curl_nss_init, /* init */
Curl_nss_cleanup, /* cleanup */
bool Curl_nss_false_start(void);
-/* Support HTTPS-proxy */
-#define HTTPS_PROXY_SUPPORT 1
-
extern const struct Curl_ssl Curl_ssl_nss;
/* Set the API backend definition to NSS */
1, /* have_certinfo */
1, /* have_pinnedpubkey */
1, /* have_ssl_ctx */
+ 1, /* support_https_proxy */
Curl_ossl_init, /* init */
Curl_ossl_cleanup, /* cleanup */
bool Curl_ossl_cert_status_request(void);
-/* Support HTTPS-proxy */
-#define HTTPS_PROXY_SUPPORT 1
-
extern const struct Curl_ssl Curl_ssl_openssl;
/* Set the API backend definition to OpenSSL */
0, /* have_certinfo */
1, /* have_pinnedpubkey */
0, /* have_ssl_ctx */
+ 0, /* support_https_proxy */
Curl_polarssl_init, /* init */
Curl_polarssl_cleanup, /* cleanup */
1, /* have_certinfo */
0, /* have_pinnedpubkey */
0, /* have_ssl_ctx */
+ 0, /* support_https_proxy */
Curl_schannel_init, /* init */
Curl_schannel_cleanup, /* cleanup */
DEBUGASSERT(conn->bits.proxy_ssl_connected[sockindex]);
if(ssl_connection_complete == conn->ssl[sockindex].state &&
!conn->proxy_ssl[sockindex].use) {
-#if defined(HTTPS_PROXY_SUPPORT)
+ if(!Curl_ssl->support_https_proxy)
+ return CURLE_NOT_BUILT_IN;
conn->proxy_ssl[sockindex] = conn->ssl[sockindex];
memset(&conn->ssl[sockindex], 0, sizeof(conn->ssl[sockindex]));
-#else
- return CURLE_NOT_BUILT_IN;
-#endif
}
return CURLE_OK;
}
unsigned have_pinnedpubkey:1; /* supports CURLOPT_PINNEDPUBLICKEY */
unsigned have_ssl_ctx:1; /* supports CURLOPT_SSL_CTX_* */
+ unsigned support_https_proxy:1; /* supports access via HTTPS proxies */
+
int (*init)(void);
void (*cleanup)(void);