Skip to content

Comments

Add function to check if environment variables are configured corretly, fixes #7#9

Merged
alexcrichton merged 1 commit intorustls:masterfrom
timvisee:check
Jul 9, 2018
Merged

Add function to check if environment variables are configured corretly, fixes #7#9
alexcrichton merged 1 commit intorustls:masterfrom
timvisee:check

Conversation

@timvisee
Copy link
Contributor

@timvisee timvisee commented Jul 7, 2018

This PR adds basic functionality in the crate to check whether the OpenSSL environment variables are configured and valid. This allows basic checking

The function has_ssl_cert_env_vars() has been added to determine whether any certificates will be found by OpenSSL through some basic environment variable checking.
The function init_ssl_cert_env_vars() now returns a bool to indicate whether any certificates were found while probing.
I've created constants for the environment variable keys to minimize duplication.

Note though, that these basic checks should be run before initializing OpenSSL, and that they are simple directory checks. It does currently not seem possible to actually check whehter the openssl crate is properly using these certificates, as it does not provide an interface for that.

Fixes #7

What do you think?

@alexcrichton alexcrichton merged commit 7c559fb into rustls:master Jul 9, 2018
@alexcrichton
Copy link
Collaborator

Looks good to me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants