summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2020-06-26 12:40:43 +0300
committerDaniel Stenberg <daniel@haxx.se>2020-06-26 14:20:20 +0200
commit989e6dffc583118e6b582be37dc193ebcbf2d5aa (patch)
tree4510ff6fff22f914efa97bd2862b0d6a59290a89
parent7de2a4ce35dee7a9409ab78962ae12894a073d60 (diff)
downloadcurl-989e6dffc583118e6b582be37dc193ebcbf2d5aa.tar.gz
mbedtls: fix build with disabled proxy support
Don't reference fields that do not exist. Fixes build failure: vtls/mbedtls.c: In function 'mbed_connect_step1': vtls/mbedtls.c:249:54: error: 'struct connectdata' has no member named 'http_proxy' Closes #5615
-rw-r--r--lib/vtls/mbedtls.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c
index ba31b8e78..545f824c6 100644
--- a/lib/vtls/mbedtls.c
+++ b/lib/vtls/mbedtls.c
@@ -246,9 +246,14 @@ mbed_connect_step1(struct connectdata *conn,
const char * const ssl_capath = SSL_CONN_CONFIG(CApath);
char * const ssl_cert = SSL_SET_OPTION(cert);
const char * const ssl_crlfile = SSL_SET_OPTION(CRLfile);
+#ifndef CURL_DISABLE_PROXY
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;
+#else
+ const char * const hostname = conn->host.name;
+ const long int port = conn->remote_port;
+#endif
int ret = -1;
char errorbuf[128];
errorbuf[0] = 0;
@@ -538,9 +543,14 @@ mbed_connect_step2(struct connectdata *conn,
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend;
const mbedtls_x509_crt *peercert;
+#ifndef CURL_DISABLE_PROXY
const char * const pinnedpubkey = SSL_IS_PROXY() ?
data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] :
data->set.str[STRING_SSL_PINNEDPUBLICKEY_ORIG];
+#else
+ const char * const pinnedpubkey =
+ data->set.str[STRING_SSL_PINNEDPUBLICKEY_ORIG];
+#endif
conn->recv[sockindex] = mbed_recv;
conn->send[sockindex] = mbed_send;