0001-bearssl-fix-build-with-disabled-proxy-support.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 3a46be47cad5a3498b5f6d6007b7d1fe5b8dff78 Mon Sep 17 00:00:00 2001
  2. Message-Id: <3a46be47cad5a3498b5f6d6007b7d1fe5b8dff78.1594274321.git.baruch@tkos.co.il>
  3. From: Baruch Siach <baruch@tkos.co.il>
  4. Date: Thu, 9 Jul 2020 08:14:49 +0300
  5. Subject: [PATCH] bearssl: fix build with disabled proxy support
  6. Avoid reference to fields that do not exist when CURL_DISABLE_PROXY is
  7. defined.
  8. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  9. ---
  10. Upstream status: https://github.com/curl/curl/pull/5666
  11. lib/vtls/bearssl.c | 11 +++++++++--
  12. 1 file changed, 9 insertions(+), 2 deletions(-)
  13. diff --git a/lib/vtls/bearssl.c b/lib/vtls/bearssl.c
  14. index 628e16a124a9..44e7406e8e39 100644
  15. --- a/lib/vtls/bearssl.c
  16. +++ b/lib/vtls/bearssl.c
  17. @@ -300,8 +300,12 @@ static CURLcode bearssl_connect_step1(struct connectdata *conn, int sockindex)
  18. struct ssl_connect_data *connssl = &conn->ssl[sockindex];
  19. struct ssl_backend_data *backend = connssl->backend;
  20. const char * const ssl_cafile = SSL_CONN_CONFIG(CAfile);
  21. +#ifndef CURL_DISABLE_PROXY
  22. const char *hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name :
  23. conn->host.name;
  24. +#else
  25. + const char *hostname = conn->host.name;
  26. +#endif
  27. const bool verifypeer = SSL_CONN_CONFIG(verifypeer);
  28. const bool verifyhost = SSL_CONN_CONFIG(verifyhost);
  29. CURLcode ret;
  30. @@ -386,8 +390,11 @@ static CURLcode bearssl_connect_step1(struct connectdata *conn, int sockindex)
  31. */
  32. #ifdef USE_NGHTTP2
  33. - if(data->set.httpversion >= CURL_HTTP_VERSION_2 &&
  34. - (!SSL_IS_PROXY() || !conn->bits.tunnel_proxy)) {
  35. + if(data->set.httpversion >= CURL_HTTP_VERSION_2
  36. +#ifndef CURL_DISABLE_PROXY
  37. + && (!SSL_IS_PROXY() || !conn->bits.tunnel_proxy)
  38. +#endif
  39. + ) {
  40. backend->protocols[cur++] = NGHTTP2_PROTO_VERSION_ID;
  41. infof(data, "ALPN, offering %s\n", NGHTTP2_PROTO_VERSION_ID);
  42. }
  43. --
  44. 2.27.0