mirror of
https://github.com/moparisthebest/curl
synced 2024-11-05 00:55:04 -05:00
bearssl: fix build with disabled proxy support
Avoid reference to fields that do not exist when CURL_DISABLE_PROXY is defined. Reviewed-by: Nicolas Sterchele Closes #5666
This commit is contained in:
parent
250ec63f97
commit
81bf2713ae
@ -300,8 +300,12 @@ static CURLcode bearssl_connect_step1(struct connectdata *conn, int sockindex)
|
|||||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||||
struct ssl_backend_data *backend = connssl->backend;
|
struct ssl_backend_data *backend = connssl->backend;
|
||||||
const char * const ssl_cafile = SSL_CONN_CONFIG(CAfile);
|
const char * const ssl_cafile = SSL_CONN_CONFIG(CAfile);
|
||||||
|
#ifndef CURL_DISABLE_PROXY
|
||||||
const char *hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name :
|
const char *hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name :
|
||||||
conn->host.name;
|
conn->host.name;
|
||||||
|
#else
|
||||||
|
const char *hostname = conn->host.name;
|
||||||
|
#endif
|
||||||
const bool verifypeer = SSL_CONN_CONFIG(verifypeer);
|
const bool verifypeer = SSL_CONN_CONFIG(verifypeer);
|
||||||
const bool verifyhost = SSL_CONN_CONFIG(verifyhost);
|
const bool verifyhost = SSL_CONN_CONFIG(verifyhost);
|
||||||
CURLcode ret;
|
CURLcode ret;
|
||||||
@ -386,8 +390,11 @@ static CURLcode bearssl_connect_step1(struct connectdata *conn, int sockindex)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef USE_NGHTTP2
|
#ifdef USE_NGHTTP2
|
||||||
if(data->set.httpversion >= CURL_HTTP_VERSION_2 &&
|
if(data->set.httpversion >= CURL_HTTP_VERSION_2
|
||||||
(!SSL_IS_PROXY() || !conn->bits.tunnel_proxy)) {
|
#ifndef CURL_DISABLE_PROXY
|
||||||
|
&& (!SSL_IS_PROXY() || !conn->bits.tunnel_proxy)
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
backend->protocols[cur++] = NGHTTP2_PROTO_VERSION_ID;
|
backend->protocols[cur++] = NGHTTP2_PROTO_VERSION_ID;
|
||||||
infof(data, "ALPN, offering %s\n", NGHTTP2_PROTO_VERSION_ID);
|
infof(data, "ALPN, offering %s\n", NGHTTP2_PROTO_VERSION_ID);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user