diff --git a/CHANGES.txt b/CHANGES.txt index fdf287b..7437c63 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +## unreleased + +* Add support for proxy types CURLPROXY_HTTPS and CURLPROXY_HTTPS2. + (Volker Diels-Grabsch) + ## 0.10.0 - 14 May 2025 * Transition from the ocurl package name to curl. diff --git a/config/discover.ml b/config/discover.ml index 00f46be..f7a9fc6 100644 --- a/config/discover.ml +++ b/config/discover.ml @@ -303,6 +303,9 @@ let curl_h_declarations = [ "CURLOPT_WRITEINFO"; "CURLOPT_XFERINFOFUNCTION"; + "CURLPROXY_HTTPS"; + "CURLPROXY_HTTPS2"; + "CURLSSLBACKEND_BEARSSL"; "CURLSSLBACKEND_GNUTLS"; "CURLSSLBACKEND_GSKIT"; diff --git a/curl-helper.c b/curl-helper.c index b7038ca..ea51f8c 100644 --- a/curl-helper.c +++ b/curl-helper.c @@ -3243,8 +3243,14 @@ static void handle_PROXYTYPE(Connection *conn, value option) case 3: proxy_type = CURLPROXY_SOCKS5; break; case 4: proxy_type = CURLPROXY_SOCKS4A; break; case 5: proxy_type = CURLPROXY_SOCKS5_HOSTNAME; break; +#if HAVE_DECL_CURLPROXY_HTTPS + case 6: proxy_type = CURLPROXY_HTTPS; break; +#endif +#if HAVE_DECL_CURLPROXY_HTTPS2 + case 7: proxy_type = CURLPROXY_HTTPS2; break; +#endif default: - caml_failwith("Invalid curl proxy type"); + caml_failwith("Unsupported curl proxy type"); } result = curl_easy_setopt(conn->handle, diff --git a/curl.ml b/curl.ml index cefa4d4..65c3218 100644 --- a/curl.ml +++ b/curl.ml @@ -244,12 +244,14 @@ type curlSeek = | SEEK_END type curlProxyType = - | CURLPROXY_HTTP - | CURLPROXY_HTTP_1_0 (** added in 7.19.4 *) - | CURLPROXY_SOCKS4 (** added in 7.15.2 *) - | CURLPROXY_SOCKS5 - | CURLPROXY_SOCKS4A (** added in 7.18.0 *) - | CURLPROXY_SOCKS5_HOSTNAME (** added in 7.18.0 *) + | CURLPROXY_HTTP (** since libcurl 7.10 *) + | CURLPROXY_HTTP_1_0 (** since libcurl 7.19.4 *) + | CURLPROXY_SOCKS4 (** since libcurl 7.15.2 *) + | CURLPROXY_SOCKS5 (** since libcurl 7.10 *) + | CURLPROXY_SOCKS4A (** since libcurl 7.18.0 *) + | CURLPROXY_SOCKS5_HOSTNAME (** since libcurl 7.18.0 *) + | CURLPROXY_HTTPS (** since libcurl 7.52.0 *) + | CURLPROXY_HTTPS2 (** since libcurl 8.1.0 *) type curlSockType = | CURLSOCKTYPE_IPCXN diff --git a/curl.mli b/curl.mli index 8efd532..69e21dc 100644 --- a/curl.mli +++ b/curl.mli @@ -252,12 +252,14 @@ type curlSeek = | SEEK_END type curlProxyType = - | CURLPROXY_HTTP + | CURLPROXY_HTTP (** since libcurl 7.10 *) | CURLPROXY_HTTP_1_0 (** since libcurl 7.19.4 *) | CURLPROXY_SOCKS4 (** since libcurl 7.15.2 *) - | CURLPROXY_SOCKS5 + | CURLPROXY_SOCKS5 (** since libcurl 7.10 *) | CURLPROXY_SOCKS4A (** since libcurl 7.18.0 *) | CURLPROXY_SOCKS5_HOSTNAME (** since libcurl 7.18.0 *) + | CURLPROXY_HTTPS (** since libcurl 7.52.0 *) + | CURLPROXY_HTTPS2 (** since libcurl 8.1.0 *) type curlSockType = | CURLSOCKTYPE_IPCXN