summaryrefslogtreecommitdiff
path: root/lib/curl_sasl.c
diff options
context:
space:
mode:
authorOkhin Vasilij <OkhinVI@gmail.com>2016-11-21 17:01:25 +0700
committerDaniel Stenberg <daniel@haxx.se>2016-11-24 23:41:45 +0100
commitc6da05a5ec0c5250df077e42647c498f8ae38e8d (patch)
tree9e14b903397afb8f2bc8d0385aa51ef90e8cb84f /lib/curl_sasl.c
parent49765cd75cdd40ceecb125ac893051be90977018 (diff)
downloadcurl-c6da05a5ec0c5250df077e42647c498f8ae38e8d.tar.gz
HTTPS-proxy: fixed mbedtls and polishing
Diffstat (limited to 'lib/curl_sasl.c')
-rw-r--r--lib/curl_sasl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c
index 6b8696216..19efbf583 100644
--- a/lib/curl_sasl.c
+++ b/lib/curl_sasl.c
@@ -262,6 +262,9 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
size_t len = 0;
saslstate state1 = SASL_STOP;
saslstate state2 = SASL_FINAL;
+ const char * const hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name :
+ conn->host.name;
+ const long int port = SSL_IS_PROXY() ? conn->port : conn->remote_port;
#if defined(USE_KERBEROS5)
const char* service = data->set.str[STRING_SERVICE_NAME] ?
data->set.str[STRING_SERVICE_NAME] :
@@ -341,8 +344,8 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
if(force_ir || data->set.sasl_ir)
result = Curl_auth_create_oauth_bearer_message(data, conn->user,
- conn->host.name,
- conn->port,
+ hostname,
+ port,
conn->oauth_bearer,
&resp, &len);
}
@@ -408,6 +411,9 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
struct Curl_easy *data = conn->data;
saslstate newstate = SASL_FINAL;
char *resp = NULL;
+ const char * const hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name :
+ conn->host.name;
+ const long int port = SSL_IS_PROXY() ? conn->port : conn->remote_port;
#if !defined(CURL_DISABLE_CRYPTO_AUTH)
char *serverdata;
char *chlg = NULL;
@@ -542,8 +548,8 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
/* Create the authorisation message */
if(sasl->authused == SASL_MECH_OAUTHBEARER) {
result = Curl_auth_create_oauth_bearer_message(data, conn->user,
- conn->host.name,
- conn->port,
+ hostname,
+ port,
conn->oauth_bearer,
&resp, &len);