refactor: replace OpenSSL transports and certificate imports

This commit is contained in:
Kevin Yue committed 2026-11-01 23:35:58 +08:00
1 parent 37c88c7adb
commit 14c4e24e0e
59 files changed
+1072 -1151

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
fn main() {
println!("cargo:rerun-if-changed=src/utils/certificate/gnutls.c");
let target = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
if !matches!(target.as_str(), "macos" | "linux" | "freebsd" | "openbsd") {
return;
}
let mut package = pkg_config::Config::new();
package.atleast_version("3.6").cargo_metadata(false);
let library = package
.probe("gnutls")
.expect("GnuTLS development files are required for desktop certificate import");
let mut build = cc::Build::new();
build.file("src/utils/certificate/gnutls.c");
for include in library.include_paths {
build.include(include);
}
build.compile("gp_certificate_import");
// GNU linkers must see the shim before its GnuTLS dependency (--as-needed).
package
.cargo_metadata(true)
.probe("gnutls")
.expect("GnuTLS was probed above");
}