Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not call openssl_probe::init_ssl_cert_env_vars() on FreeBSD (#1129) #1130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michael-o
Copy link

The heuristics in openssl-probe leave the process environment with an invalid value breaking the certificate validation on FreeBSD. FreeBSD has a system truststore managed by certctl(8). Leave it to OpenSSL to do the right thing.

Upstream issue: alexcrichton/openssl-probe#37

This fixes #1129

…lang#1129)

The heuristics in openssl-probe leave the process environment with an invalid
value breaking the certificate validation on FreeBSD. FreeBSD has a system
truststore managed by certctl(8). Leave it to OpenSSL to do the right thing.

Upstream issue: alexcrichton/openssl-probe#37

This fixes rust-lang#1129
@rustbot rustbot added the S-waiting-on-review Status: Waiting on review label Feb 24, 2025
michael-o added a commit to michael-o/freebsd-ports that referenced this pull request Feb 24, 2025
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 certlctl(8) manages
everything nicely.

Upstream issues:
* alexcrichton/openssl-probe#37
* rust-lang/git2-rs#1130

Reviewed by:	jrm (mentor), otis (mentor), ...
MFH:		2025Q1
@michael-o
Copy link
Author

@emaste FYI

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Mar 7, 2025
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
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Mar 7, 2025
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

(cherry picked from commit 0780826)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Waiting on review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling openssl_env_init() on FreeBSD breaks certificate validation with the system default trutstore
2 participants