Skip to content

Commit 0780826

Browse files
committed
lang/rust: Make OpenSSL use the system default truststore in Cargo
Cargo uses curl-rust and git2-rs (which uses curl-rest as well). Unfortunately, git2-rs calls openssl_probe::init_ssl_cert_env_vars() unconditionally which breaks the process environment by setting an invalid value for SSL_CERT_DIR and then the system default truststore is circumvented, resulting in certificate validation errors even if certctl(8) manages everything nicely. Upstream issues: * alexcrichton/openssl-probe#37 * rust-lang/git2-rs#1130 Reviewed by: jrm (mentor), mikael (rust) MFH: 2025Q1 Differential Revision: https://reviews.freebsd.org/D49120
1 parent 6c97650 commit 0780826

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

lang/rust/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PORTNAME= rust
22
PORTVERSION?= 1.85.0
3-
PORTREVISION?= 0
3+
PORTREVISION?= 1
44
CATEGORIES= lang
55
MASTER_SITES= https://static.rust-lang.org/dist/:src \
66
https://dev-static.rust-lang.org/dist/:src \
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- vendor/git2-0.19.0/src/lib.rs.orig 2025-02-21 20:02:44 UTC
2+
+++ vendor/git2-0.19.0/src/lib.rs
3+
@@ -759,6 +759,7 @@ fn init() {
4+
unix,
5+
not(target_os = "macos"),
6+
not(target_os = "ios"),
7+
+ not(target_os = "freebsd"),
8+
feature = "https"
9+
))]
10+
fn openssl_env_init() {
11+
@@ -880,6 +881,7 @@ fn openssl_env_init() {
12+
windows,
13+
target_os = "macos",
14+
target_os = "ios",
15+
+ target_os = "freebsd",
16+
not(feature = "https")
17+
))]
18+
fn openssl_env_init() {}

0 commit comments

Comments
 (0)