Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
rust: Fix cargo SSL errors.
Browse files Browse the repository at this point in the history
Cargo uses its own vendored libcurl which it statically links
against. This patches the build configuration to set
CURL_CA_BUNDLE and CURL_CA_PATH.

I am still unsure as to why this broke, why this only affects
KISS with OpenSSL 3.0.0, etc. Will see if the next rust release
improves this else will open a bug report upstream.

Closes #339
  • Loading branch information
dylanaraps committed Oct 8, 2021
1 parent 46c9ec7 commit 39d519f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
3 changes: 3 additions & 0 deletions extra/rust/build
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh -e

rm -f vendor/curl-sys/.cargo-checksum.json
patch -p1 < fix-curl.patch

# Instruct the compiler to trim absolute paths in resulting binaries and instead
# change them to relative paths ($PWD/... ./...).
export RUSTFLAGS="$RUSTFLAGS --remap-path-prefix=$PWD=."
Expand Down
1 change: 1 addition & 0 deletions extra/rust/checksums
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ aec85a7c1f40b7a40818a58ae13632f8a12cfaa4d3e2a10957d0e9d16dfdd556
c2de24eb3e524c0fdd1e8116f578c103035da1ece1e4c06efab67999180eefe8
5cffd160f5daac521652ee67c62947c0d66bdc8e5ebf7dc93114cdff9a934b0b
9a26b73e578227d111b221932d7cbeaf4b41f27a0f7597a49efb81e2bd0791f9
f68fbed74118bff6df74dbdd1507e646e6627c95444fde90a6bb66b51b677cff
33 changes: 33 additions & 0 deletions extra/rust/patches/fix-curl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/Cargo.lock b/Cargo.lock
index 085aae3..ccedf97 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -873,7 +873,7 @@ dependencies = [
name = "curl-sys"
version = "0.4.45+curl-7.78.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de9e5a72b1c744eb5dd20b2be4d7eb84625070bb5c4ab9b347b70464ab1e62eb"
+checksum = "d8f1e2562c5784ad3348906a9c7e2e435c8bc5c8796a4398d322456d9a2710c1"
dependencies = [
"cc",
"libc",
diff --git a/vendor/curl-sys/.cargo-checksum.json b/vendor/curl-sys/.cargo-checksum.json
new file mode 100644
index 0000000..b3a3efe
--- /dev/null
+++ b/vendor/curl-sys/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{},"package":"d8f1e2562c5784ad3348906a9c7e2e435c8bc5c8796a4398d322456d9a2710c1"}
diff --git a/vendor/curl-sys/build.rs b/vendor/curl-sys/build.rs
index 7b66756..a7c7122 100644
--- a/vendor/curl-sys/build.rs
+++ b/vendor/curl-sys/build.rs
@@ -109,6 +109,8 @@ fn main() {
.include("curl/lib")
.include("curl/include")
.define("BUILDING_LIBCURL", None)
+ .define("CURL_CA_BUNDLE", "\"/etc/ssl/cert.pem\"")
+ .define("CURL_CA_PATH", "\"/etc/ssl/certs\"")
.define("CURL_DISABLE_CRYPTO_AUTH", None)
.define("CURL_DISABLE_DICT", None)
.define("CURL_DISABLE_GOPHER", None)
1 change: 1 addition & 0 deletions extra/rust/sources
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ https://static.rust-lang.org/dist/rustc-VERSION-src.tar.xz
https://static.rust-lang.org/dist/2021-07-29/rust-std-1.54.0-x86_64-unknown-linux-musl.tar.xz?no-extract
https://static.rust-lang.org/dist/2021-07-29/rustc-1.54.0-x86_64-unknown-linux-musl.tar.xz?no-extract
https://static.rust-lang.org/dist/2021-07-29/cargo-1.54.0-x86_64-unknown-linux-musl.tar.xz?no-extract
patches/fix-curl.patch
2 changes: 1 addition & 1 deletion extra/rust/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.55.0 1
1.55.0 3

0 comments on commit 39d519f

Please sign in to comment.