diff --git a/src/core/nm-connectivity.c b/src/core/nm-connectivity.c index c84d8a56ac..2074c2aee2 100644 --- a/src/core/nm-connectivity.c +++ b/src/core/nm-connectivity.c @@ -695,7 +695,12 @@ do_curl_request(NMConnectivityCheckHandle *cb_data) curl_easy_setopt(ehandle, CURLOPT_INTERFACE, cb_data->ifspec); curl_easy_setopt(ehandle, CURLOPT_RESOLVE, cb_data->concheck.hosts); curl_easy_setopt(ehandle, CURLOPT_IPRESOLVE, resolve); + +#if LIBCURL_VERSION_NUM >= 0x075500 /* libcurl 7.85.0 */ + curl_easy_setopt(ehandle, CURLOPT_PROTOCOLS_STR, "HTTP,HTTPS"); +#else curl_easy_setopt(ehandle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); +#endif curl_multi_add_handle(mhandle, ehandle); } diff --git a/src/nm-cloud-setup/nm-http-client.c b/src/nm-cloud-setup/nm-http-client.c index 7ef9f38d34..e5657ac458 100644 --- a/src/nm-cloud-setup/nm-http-client.c +++ b/src/nm-cloud-setup/nm-http-client.c @@ -305,7 +305,12 @@ nm_http_client_get(NMHttpClient *self, curl_easy_setopt(edata->ehandle, CURLOPT_WRITEFUNCTION, _get_writefunction_cb); curl_easy_setopt(edata->ehandle, CURLOPT_WRITEDATA, edata); curl_easy_setopt(edata->ehandle, CURLOPT_PRIVATE, edata); + +#if LIBCURL_VERSION_NUM >= 0x075500 /* libcurl 7.85.0 */ + curl_easy_setopt(edata->ehandle, CURLOPT_PROTOCOLS_STR, "HTTP,HTTPS"); +#else curl_easy_setopt(edata->ehandle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); +#endif if (http_headers) { for (i = 0; http_headers[i]; ++i) {