You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add_root_certificate does not seem to add a certificate when SSL_CERT_FILE is not set or points to an invalid path. Consider the example program below using reqwest.
[dependencies]
reqwest = { version = "*", features = ["blocking", "native-tls", "native-tls-vendored"] }
This works fine when running cargo run. However, running env SSL_CERT_FILE=/a/bad/path cargo run produces the error unable to get local issuer certificate. Switching to use rustls instead of the native-tls backend works.
[dependencies]
reqwest = { version = "*", default-features = false, features = ["blocking", "rustls-tls"] }
This is obviously a very contrived example, but this situation does arise when vendoring openssl with the vendored feature and running on a system without openssl installed. In this case, openssl-probe is unable to set the SSL_CERT_FILE env var leading to the same behavior as when it is set to an invalid path.
The text was updated successfully, but these errors were encountered:
Aha! That explains it. Thank you! ... For those interested the working code that uses the pem crate can be found below. Would you be interested in a PR that adds the ability to make a Vec of Certificates from a buffer? I would essentially copy the functionality from rustlshere.
add_root_certificate
does not seem to add a certificate whenSSL_CERT_FILE
is not set or points to an invalid path. Consider the example program below usingreqwest
.This works fine when running
cargo run
. However, runningenv SSL_CERT_FILE=/a/bad/path cargo run
produces the errorunable to get local issuer certificate
. Switching to userustls
instead of thenative-tls
backend works.This is obviously a very contrived example, but this situation does arise when vendoring openssl with the
vendored
feature and running on a system withoutopenssl
installed. In this case,openssl-probe
is unable to set theSSL_CERT_FILE
env var leading to the same behavior as when it is set to an invalid path.The text was updated successfully, but these errors were encountered: