-
Notifications
You must be signed in to change notification settings - Fork 408
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
base: master
Are you sure you want to change the base?
Do not call openssl_probe::init_ssl_cert_env_vars() on FreeBSD (#1129) #1130
Conversation
…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
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
@emaste FYI |
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
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)
Sorry, I don't know much about FreeBSD in this regard. @asomers do you perhaps have any knowledge here? Can you say why this wouldn't be a fix in |
Fro two reasons:
Don't set anything explicit if it works works flawless implicit: SSL_CTX_set_default_verify_paths I have already committed the patch downstream in FreeBSD's Rust port to fix Cargo, but this doesn't fix standalone use of this library: freebsd/freebsd-ports@0780826 |
Sorry @ehuss ; I'm not knowledgeable about this issue. |
@ehuss Do you have any objections/pain to merge this? |
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