From d9d0f9fba12c4de8bfd7692ea299702d171bfbd6 Mon Sep 17 00:00:00 2001 From: cssivision Date: Wed, 26 Jul 2017 12:57:29 +0800 Subject: [PATCH 1/2] Add openssl certificate look up --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 22af07d..430df45 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,16 @@ libraries: - The standard `musl-libc` libraries. - OpenSSL, which is needed by many Rust applications. +statically linked OpenSSL to the binary and if you need some for of CA certificate store to validate certificates(may be a https request), you need to add some code in your application, for [detail](https://github.com/emk/rust-musl-builder/issues/21). +```rust +extern crate openssl_probe; + +fn main() { + openssl_probe::init_ssl_cert_env_vars(); + //... your code +} +``` + ## Adding more C libraries If you're using Docker crates which require specific C libraries to be From 33fc8d98f3800823246138da63e54b9390f71883 Mon Sep 17 00:00:00 2001 From: Eric Kidd Date: Fri, 15 Sep 2017 11:55:08 -0400 Subject: [PATCH 2/2] Edit documentation for `openssl-probe` @dkastner tested this out this proposed code snippet from @cssivision. Thank you! --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 430df45..53058b7 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,10 @@ libraries: - The standard `musl-libc` libraries. - OpenSSL, which is needed by many Rust applications. -statically linked OpenSSL to the binary and if you need some for of CA certificate store to validate certificates(may be a https request), you need to add some code in your application, for [detail](https://github.com/emk/rust-musl-builder/issues/21). +## Making OpenSSL work + +If your application uses OpenSSL, you will also need to take a few extra steps to make sure that it can find OpenSSL's list of trusted certificates, which is stored in different locations on different Linux distributions. You can do this using [`openssl-probe`](https://crates.io/crates/openssl-probe) as follows: + ```rust extern crate openssl_probe;