Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ socket2 = "0.6.0"
openssl-sys = { workspace = true, optional = true }
openssl-probe = { version = "0.1.2", optional = true }

[target.'cfg(target_env = "msvc")'.dependencies]
schannel = "0.1.13"
windows-sys = { workspace = true, features = ["Win32_Foundation", "Win32_System_LibraryLoader", "Win32_Security_Cryptography"] }
[target.'cfg(windows)'.dependencies]
schannel = { version = "0.1.13", optional = true }
windows-sys = { workspace = true, optional = true, features = ["Win32_Foundation", "Win32_System_LibraryLoader", "Win32_Security_Cryptography"] }

[dev-dependencies]
mio = "0.6"
Expand All @@ -48,7 +48,15 @@ spnego = ["curl-sys/spnego"]
rustls = ["curl-sys/rustls"]
static-curl = ["curl-sys/static-curl"]
static-ssl = ["curl-sys/static-ssl"]
windows-static-ssl = ["static-curl", "curl-sys/windows-static-ssl"]
windows-cert-store = [
"dep:schannel",
"dep:windows-sys",
]
windows-static-ssl = [
"static-curl",
"curl-sys/windows-static-ssl",
"windows-cert-store",
]
force-system-lib-on-osx = ['curl-sys/force-system-lib-on-osx']
protocol-ftp = ["curl-sys/protocol-ftp"]
zlib-ng-compat = ["curl-sys/zlib-ng-compat", "static-curl"]
Expand Down
6 changes: 3 additions & 3 deletions src/easy/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use libc::c_void;

#[cfg(target_env = "msvc")]
#[cfg(all(windows, feature = "windows-cert-store"))]
mod win {
use schannel::cert_context::ValidUses;
use schannel::cert_store::CertStore;
Expand Down Expand Up @@ -116,12 +116,12 @@ mod win {
}
}

#[cfg(target_env = "msvc")]
#[cfg(all(windows, feature = "windows-cert-store"))]
pub fn add_certs_to_context(ssl_ctx: *mut c_void) {
unsafe {
win::add_certs_to_context(ssl_ctx as *mut _);
}
}

#[cfg(not(target_env = "msvc"))]
#[cfg(not(all(windows, feature = "windows-cert-store")))]
pub fn add_certs_to_context(_: *mut c_void) {}
Loading