-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add termux support #2
Conversation
Termux is Android terminal emulator and Linux environment app, some users are expecting to use rustc on termux (including some chromebook users). This will help fix rust-lang/rustup#1058. Even if sfackler/rust-openssl#610 got fixed, termux has its own environment, so it seems reasonable to use termux installed certificates. |
According to this comment this may not work? In testing locally though does this work out for you? |
Running this program extern crate openssl_probe;
pub fn main() {
openssl_probe::init_ssl_cert_env_vars();
println!("{:?}", ::std::env::var_os("SSL_CERT_FILE"));
} on my phone prints:
Which is the correct path. Testing with rustup is a bit more complicated (I would have to set various path dependencies...), but considering this simple example, I think it will work. Note that Can you clarify why the comment you link suggest that it may not work? |
Oh right yeah I'm confident the env vars are set, but is that actually read by Cargo/rustup and does it fix the certificate problems you were seeing? |
Ok, after some trouble I was able to build rustup-init with this update and can assert that it worked. I checked the rustup code and it is using curl crate (the direct call to Sorry for trying to hurry... |
Oh no worries! Just wanted to make sure we had at least one data point :) Thanks for checking! |
Thanks! You you mind releasing a 0.1.1 version? |
Certainly, done! |
Could it be something like this? pub fn find_certs_dirs() -> Vec<PathBuf> {
// see http://gagravarr.org/writing/openssl-certs/others.shtml
let prefix = var_os("PREFIX").unwrap_or("");
[
"/var/ssl",
"/usr/share/ssl",
"/usr/local/ssl",
"/usr/local/openssl",
"/usr/local/share",
"/usr/lib/ssl",
"/usr/ssl",
"/etc/openssl",
"/etc/pki/tls",
"/etc/ssl",
"/etc/tls",
].iter().map(|s| PathBuf::from(*s)).filter(|p| {
fs::metadata(format!("{}{}", prefix, p)).is_ok()
}).collect()
} so, every system that has a PREFIX like termux does would be covered here |
Do you know other systems that use PREFIX env var? |
@malbarbo I don't know but it would be cool because autotools also allows |
No description provided.