aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Glanzmann <thomas@glanzmann.de>2016-11-24 19:40:30 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-11-25 10:01:58 +0100
commit1232dbb8bd49b5502834ae9dd9f7ab1cb7a88b7b (patch)
treece193ca1d845f57b23a2b7001db7885b532345ce /lib
parent8ebc5cda8f4f53e26ce822cd831001cc2332945e (diff)
url: proxy: Use 443 as default port for https proxies
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c8
-rw-r--r--lib/url.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index 5dee7a770..8b404ba6b 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -528,7 +528,7 @@ CURLcode Curl_init_userdefined(struct UserDefined *set)
/* Set the default size of the SSL session ID cache */
set->general_ssl.max_ssl_sessions = 5;
- set->proxyport = CURL_DEFAULT_PROXY_PORT; /* from url.h */
+ set->proxyport = 0;
set->proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
set->httpauth = CURLAUTH_BASIC; /* defaults to basic */
set->proxyauth = CURLAUTH_BASIC; /* defaults to basic */
@@ -4997,6 +4997,12 @@ static CURLcode parse_proxy(struct Curl_easy *data,
/* None given in the proxy string, then get the default one if it is
given */
port = data->set.proxyport;
+ else {
+ if(proxytype == CURLPROXY_HTTPS)
+ port = CURL_DEFAULT_HTTPS_PROXY_PORT;
+ else
+ port = CURL_DEFAULT_PROXY_PORT;
+ }
}
if(*proxyptr) {
diff --git a/lib/url.h b/lib/url.h
index c1254f5dc..f13c8e664 100644
--- a/lib/url.h
+++ b/lib/url.h
@@ -67,6 +67,8 @@ void Curl_getoff_all_pipelines(struct Curl_easy *data,
void Curl_close_connections(struct Curl_easy *data);
#define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */
+#define CURL_DEFAULT_HTTPS_PROXY_PORT 443 /* default https proxy port unless
+ specified */
CURLcode Curl_connected_proxy(struct connectdata *conn, int sockindex);