]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls: repair build with disabled proxy
authorDaniel Stenberg <daniel@haxx.se>
Wed, 23 Nov 2022 15:11:25 +0000 (16:11 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 24 Nov 2022 08:04:14 +0000 (09:04 +0100)
Closes #9974

lib/vtls/openssl.c
lib/vtls/vtls.c

index 57d8054ccbf11f35aaedb0175a2338ba8b39b9ab..a6bd294dec498611f31aaaf2813b6420a36614ef 100644 (file)
@@ -3317,9 +3317,11 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf,
   void *ssl_sessionid = NULL;
   struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
   struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
+#ifndef CURL_DISABLE_PROXY
   struct Curl_cfilter *cf_ssl_next = Curl_ssl_cf_get_ssl(cf->next);
   struct ssl_connect_data *connssl_next = cf_ssl_next?
-                                            cf_ssl_next->ctx : NULL;
+    cf_ssl_next->ctx : NULL;
+#endif
 
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
   bool sni;
index 91fdd2f005c89aae8ebc186f3fb77aed1fe7220c..9ab54c6c30760ec716d7ad8218e2f9306fefd695 100644 (file)
@@ -387,10 +387,6 @@ bool Curl_ssl_getsessionid(struct Curl_cfilter *cf,
   *ssl_sessionid = NULL;
   if(!ssl_config)
     return TRUE;
-#ifdef CURL_DISABLE_PROXY
-  if(isProxy)
-    return TRUE;
-#endif
 
   DEBUGASSERT(ssl_config->primary.sessionid);
 
@@ -1442,13 +1438,16 @@ static void reinit_hostname(struct Curl_cfilter *cf)
 {
   struct ssl_connect_data *connssl = cf->ctx;
 
+#ifndef CURL_DISABLE_PROXY
   if(Curl_ssl_cf_is_proxy(cf)) {
     /* TODO: there is not definition for a proxy setup on a secondary conn */
     connssl->hostname = cf->conn->http_proxy.host.name;
     connssl->dispname = cf->conn->http_proxy.host.dispname;
     connssl->port = (int)cf->conn->http_proxy.port;
   }
-  else {
+  else
+#endif
+  {
     /* TODO: secondaryhostname is set to the IP address we connect to
      * in the FTP handler, it is assumed that host verification uses the
      * hostname from FIRSTSOCKET */
@@ -1778,7 +1777,12 @@ bool Curl_ssl_cf_is_proxy(struct Curl_cfilter *cf)
 struct ssl_config_data *
 Curl_ssl_cf_get_config(struct Curl_cfilter *cf, struct Curl_easy *data)
 {
+#ifdef CURL_DISABLE_PROXY
+  (void)cf;
+  return &data->set.ssl;
+#else
   return Curl_ssl_cf_is_proxy(cf)? &data->set.proxy_ssl : &data->set.ssl;
+#endif
 }
 
 struct ssl_config_data *
@@ -1795,8 +1799,12 @@ Curl_ssl_get_config(struct Curl_easy *data, int sockindex)
 struct ssl_primary_config *
 Curl_ssl_cf_get_primary_config(struct Curl_cfilter *cf)
 {
+#ifdef CURL_DISABLE_PROXY
+  return &cf->conn->ssl_config;
+#else
   return Curl_ssl_cf_is_proxy(cf)?
     &cf->conn->proxy_ssl_config : &cf->conn->ssl_config;
+#endif
 }
 
 struct ssl_primary_config *