if(config->oauth_bearer)
my_setopt_str(curl, CURLOPT_XOAUTH2_BEARER, config->oauth_bearer);
- {
- my_setopt_str(curl, CURLOPT_PROXY, config->proxy);
- /* new in libcurl 7.5 */
- if(config->proxy)
- my_setopt_enum(curl, CURLOPT_PROXYTYPE, config->proxyver);
-
- my_setopt_str(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd);
-
- /* new in libcurl 7.3 */
- my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel?1L:0L);
-
- /* new in libcurl 7.52.0 */
- if(config->preproxy)
- my_setopt_str(curl, CURLOPT_PRE_PROXY, config->preproxy);
-
- /* new in libcurl 7.10.6 */
- if(config->proxyanyauth)
- my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
- (long)CURLAUTH_ANY);
- else if(config->proxynegotiate)
- my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
- (long)CURLAUTH_GSSNEGOTIATE);
- else if(config->proxyntlm)
- my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
- (long)CURLAUTH_NTLM);
- else if(config->proxydigest)
- my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
- (long)CURLAUTH_DIGEST);
- else if(config->proxybasic)
- my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
- (long)CURLAUTH_BASIC);
-
- /* new in libcurl 7.19.4 */
- my_setopt_str(curl, CURLOPT_NOPROXY, config->noproxy);
-
- my_setopt(curl, CURLOPT_SUPPRESS_CONNECT_HEADERS,
- config->suppress_connect_headers?1L:0L);
+ my_setopt_str(curl, CURLOPT_PROXY, config->proxy);
+
+ if(config->proxy && result) {
+ errorf(global, "proxy support is disabled in this libcurl\n");
+ config->synthetic_error = TRUE;
+ result = CURLE_NOT_BUILT_IN;
+ break;
}
+ /* new in libcurl 7.5 */
+ if(config->proxy)
+ my_setopt_enum(curl, CURLOPT_PROXYTYPE, config->proxyver);
+
+ my_setopt_str(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd);
+
+ /* new in libcurl 7.3 */
+ my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel?1L:0L);
+
+ /* new in libcurl 7.52.0 */
+ if(config->preproxy)
+ my_setopt_str(curl, CURLOPT_PRE_PROXY, config->preproxy);
+
+ /* new in libcurl 7.10.6 */
+ if(config->proxyanyauth)
+ my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
+ (long)CURLAUTH_ANY);
+ else if(config->proxynegotiate)
+ my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
+ (long)CURLAUTH_GSSNEGOTIATE);
+ else if(config->proxyntlm)
+ my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
+ (long)CURLAUTH_NTLM);
+ else if(config->proxydigest)
+ my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
+ (long)CURLAUTH_DIGEST);
+ else if(config->proxybasic)
+ my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
+ (long)CURLAUTH_BASIC);
+
+ /* new in libcurl 7.19.4 */
+ my_setopt_str(curl, CURLOPT_NOPROXY, config->noproxy);
+
+ my_setopt(curl, CURLOPT_SUPPRESS_CONNECT_HEADERS,
+ config->suppress_connect_headers?1L:0L);
+
my_setopt(curl, CURLOPT_FAILONERROR, config->failonerror?1L:0L);
my_setopt(curl, CURLOPT_REQUEST_TARGET, config->request_target);
my_setopt(curl, CURLOPT_UPLOAD, per->uploadfile?1L:0L);
}
/* For the time being if --proxy-capath is not set then we use the
--capath value for it, if any. See #1257 */
- if((config->proxy_capath || config->capath) &&
- !tool_setopt_skip(CURLOPT_PROXY_CAPATH)) {
+ if(config->proxy_capath || config->capath) {
result = res_setopt_str(curl, CURLOPT_PROXY_CAPATH,
(config->proxy_capath ?
config->proxy_capath :
my_setopt_enum(curl, CURLOPT_SSLVERSION,
config->ssl_version | config->ssl_version_max);
- my_setopt_enum(curl, CURLOPT_PROXY_SSLVERSION,
- config->proxy_ssl_version);
+ if(config->proxy)
+ my_setopt_enum(curl, CURLOPT_PROXY_SSLVERSION,
+ config->proxy_ssl_version);
{
long mask =
#include "tool_setopt.h"
#endif /* CURL_DISABLE_LIBCURL_OPTION */
-
-/*
- * tool_setopt_skip() allows the curl tool code to avoid setopt options that
- * are explicitly disabled in the build.
- */
-bool tool_setopt_skip(CURLoption tag)
-{
-#ifdef CURL_DISABLE_PROXY
-#define USED_TAG
- switch(tag) {
- case CURLOPT_HAPROXYPROTOCOL:
- case CURLOPT_HTTPPROXYTUNNEL:
- case CURLOPT_NOPROXY:
- case CURLOPT_PRE_PROXY:
- case CURLOPT_PROXY:
- case CURLOPT_PROXYAUTH:
- case CURLOPT_PROXY_CAINFO:
- case CURLOPT_PROXY_CAPATH:
- case CURLOPT_PROXY_CRLFILE:
- case CURLOPT_PROXYHEADER:
- case CURLOPT_PROXY_KEYPASSWD:
- case CURLOPT_PROXYPASSWORD:
- case CURLOPT_PROXY_PINNEDPUBLICKEY:
- case CURLOPT_PROXYPORT:
- case CURLOPT_PROXY_SERVICE_NAME:
- case CURLOPT_PROXY_SSLCERT:
- case CURLOPT_PROXY_SSLCERTTYPE:
- case CURLOPT_PROXY_SSL_CIPHER_LIST:
- case CURLOPT_PROXY_SSLKEY:
- case CURLOPT_PROXY_SSLKEYTYPE:
- case CURLOPT_PROXY_SSL_OPTIONS:
- case CURLOPT_PROXY_SSL_VERIFYHOST:
- case CURLOPT_PROXY_SSL_VERIFYPEER:
- case CURLOPT_PROXY_SSLVERSION:
- case CURLOPT_PROXY_TLS13_CIPHERS:
- case CURLOPT_PROXY_TLSAUTH_PASSWORD:
- case CURLOPT_PROXY_TLSAUTH_TYPE:
- case CURLOPT_PROXY_TLSAUTH_USERNAME:
- case CURLOPT_PROXY_TRANSFER_MODE:
- case CURLOPT_PROXYTYPE:
- case CURLOPT_PROXYUSERNAME:
- case CURLOPT_PROXYUSERPWD:
- return TRUE;
- default:
- break;
- }
-#endif
-#ifdef CURL_DISABLE_FTP
-#define USED_TAG
- switch(tag) {
- case CURLOPT_FTPPORT:
- case CURLOPT_FTP_ACCOUNT:
- case CURLOPT_FTP_ALTERNATIVE_TO_USER:
- case CURLOPT_FTP_FILEMETHOD:
- case CURLOPT_FTP_SKIP_PASV_IP:
- case CURLOPT_FTP_USE_EPRT:
- case CURLOPT_FTP_USE_EPSV:
- case CURLOPT_FTP_USE_PRET:
- case CURLOPT_KRBLEVEL:
- return TRUE;
- default:
- break;
- }
-#endif
-#ifdef CURL_DISABLE_RTSP
-#define USED_TAG
- switch(tag) {
- case CURLOPT_INTERLEAVEDATA:
- return TRUE;
- default:
- break;
- }
-#endif
-#if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
-#define USED_TAG
- switch(tag) {
- case CURLOPT_COOKIE:
- case CURLOPT_COOKIEFILE:
- case CURLOPT_COOKIEJAR:
- case CURLOPT_COOKIESESSION:
- return TRUE;
- default:
- break;
- }
-#endif
-#if defined(CURL_DISABLE_TELNET)
-#define USED_TAG
- switch(tag) {
- case CURLOPT_TELNETOPTIONS:
- return TRUE;
- default:
- break;
- }
-#endif
-#ifdef CURL_DISABLE_TFTP
-#define USED_TAG
- switch(tag) {
- case CURLOPT_TFTP_BLKSIZE:
- case CURLOPT_TFTP_NO_OPTIONS:
- return TRUE;
- default:
- break;
- }
-#endif
-#ifdef CURL_DISABLE_NETRC
-#define USED_TAG
- switch(tag) {
- case CURLOPT_NETRC:
- case CURLOPT_NETRC_FILE:
- return TRUE;
- default:
- break;
- }
-#endif
-
-#ifndef USED_TAG
- (void)tag;
-#endif
- return FALSE;
-}