Skip to content

Commit 9c2d8a4

Browse files
authored
Add support for HTTPS proxy feature (#464) (#468)
1 parent c36cfcc commit 9c2d8a4

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

curl-sys/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ pub const CURL_VERSION_TLSAUTH_SRP: c_int = 1 << 14;
907907
pub const CURL_VERSION_NTLM_WB: c_int = 1 << 15;
908908
pub const CURL_VERSION_HTTP2: c_int = 1 << 16;
909909
pub const CURL_VERSION_UNIX_SOCKETS: c_int = 1 << 19;
910+
pub const CURL_VERSION_HTTPS_PROXY: c_int = 1 << 21;
910911
pub const CURL_VERSION_BROTLI: c_int = 1 << 23;
911912
pub const CURL_VERSION_ALTSVC: c_int = 1 << 24;
912913
pub const CURL_VERSION_HTTP3: c_int = 1 << 25;

src/version.rs

+6
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ impl Version {
140140
self.flag(curl_sys::CURL_VERSION_UNIX_SOCKETS)
141141
}
142142

143+
/// Returns whether libcurl was built with support for HTTPS proxy.
144+
pub fn feature_https_proxy(&self) -> bool {
145+
self.flag(curl_sys::CURL_VERSION_HTTPS_PROXY)
146+
}
147+
143148
/// Returns whether libcurl was built with support for HTTP2.
144149
pub fn feature_http2(&self) -> bool {
145150
self.flag(curl_sys::CURL_VERSION_HTTP2)
@@ -413,6 +418,7 @@ impl fmt::Debug for Version {
413418
"feature_unix_domain_socket",
414419
&self.feature_unix_domain_socket(),
415420
)
421+
.field("feature_https_proxy", &self.feature_https_proxy())
416422
.field("feature_altsvc", &self.feature_altsvc())
417423
.field("feature_zstd", &self.feature_zstd())
418424
.field("feature_unicode", &self.feature_unicode())

systest/build.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ fn main() {
190190
| "CURLOPT_PROXY_SSLCERTTYPE"
191191
| "CURLOPT_PROXY_SSLKEY"
192192
| "CURLOPT_PROXY_SSLKEYTYPE"
193-
| "CURLOPT_PROXY_SSLVERSION" => return true,
193+
| "CURLOPT_PROXY_SSLVERSION"
194+
| "CURL_VERSION_HTTPS_PROXY" => return true,
194195
_ => {}
195196
}
196197
}

0 commit comments

Comments
 (0)