]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sectransp: make it build with --disable-proxy
authorDaniel Stenberg <daniel@haxx.se>
Wed, 30 Sep 2020 07:12:49 +0000 (09:12 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 30 Sep 2020 08:32:17 +0000 (10:32 +0200)
Follow-up from #5466 and f3d501dc678d80
Reported-by: Javier Navarro
Fixes #6025
Closes #6026

lib/vtls/sectransp.c

index 1e2e93aece1cd851d89ee58b5375259b229673a0..af63df46ae9d02874375208b7a30ae686df8e7aa 100644 (file)
@@ -1399,9 +1399,14 @@ static CURLcode sectransp_connect_step1(struct connectdata *conn,
   const bool verifypeer = SSL_CONN_CONFIG(verifypeer);
   char * const ssl_cert = SSL_SET_OPTION(primary.clientcert);
   const struct curl_blob *ssl_cert_blob = SSL_SET_OPTION(primary.cert_blob);
+#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
 #ifdef ENABLE_IPV6
   struct in6_addr addr;
 #else
@@ -1606,8 +1611,11 @@ static CURLcode sectransp_connect_step1(struct connectdata *conn,
                                                        &kCFTypeArrayCallBacks);
 
 #ifdef USE_NGHTTP2
-      if(data->set.httpversion >= CURL_HTTP_VERSION_2 &&
-         (!SSL_IS_PROXY() || !conn->bits.tunnel_proxy)) {
+      if(data->set.httpversion >= CURL_HTTP_VERSION_2
+#ifndef CURL_DISABLE_PROXY
+         && (!SSL_IS_PROXY() || !conn->bits.tunnel_proxy)
+#endif
+        ) {
         CFArrayAppendValue(alpnArr, CFSTR(NGHTTP2_PROTO_VERSION_ID));
         infof(data, "ALPN, offering %s\n", NGHTTP2_PROTO_VERSION_ID);
       }
@@ -2379,8 +2387,12 @@ sectransp_connect_step2(struct connectdata *conn, int sockindex)
   OSStatus err;
   SSLCipherSuite cipher;
   SSLProtocol protocol = 0;
+#ifndef CURL_DISABLE_PROXY
   const char * const hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name :
     conn->host.name;
+#else
+  const char * const hostname = conn->host.name;
+#endif
 
   DEBUGASSERT(ssl_connect_2 == connssl->connecting_state
               || ssl_connect_2_reading == connssl->connecting_state