Skip to content
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

Test for /etc/ssl/cert.pem existence to avoid masking SSL_CA_CERT_PATH #1368

Closed
wants to merge 1 commit into from

Conversation

neirbowj
Copy link
Contributor

@neirbowj neirbowj commented Jan 3, 2016

Prior to this patch, unless SSL_CA_CERT_FILE is set in the environment, libfetch will set the CA file to "/usr/local/etc/cert.pem" if it exists, and to "/etc/ssl/cert.pem" otherwise. This has the consequence of masking SSL_CA_CERT_PATH, because OpenSSL will ignore the CA path if a CA file is set but fails to load (see X509_STORE_load_locations()).

While here, fall back to OpenSSL defaults if neither SSL_CA_CERT_FILE nor SSL_CA_CERT_PATH are set in the environment, and if neither of the libfetch default CA files exists.

This patch is also submitted upstream against PR 193871 as review D4771.

Prior to this patch, unless SSL_CA_CERT_FILE is set in the environment,
libfetch will set the CA file to "/usr/local/etc/cert.pem" if it exists,
and to "/etc/ssl/cert.pem" otherwise. This has the consequence of
masking SSL_CA_CERT_PATH, because OpenSSL will ignore the CA path if a CA
file is set but fails to load (see X509_STORE_load_locations()).

While here, fall back to OpenSSL defaults if neither SSL_CA_CERT_FILE nor
SSL_CA_CERT_PATH are set in the environment, and if neither of the
libfetch default CA files exists.

This patch is also submitted upstream against
[PR 193871](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193871)
as [review D4771](https://reviews.freebsd.org/D4771).
@neirbowj
Copy link
Contributor Author

neirbowj commented Jan 3, 2016

I should have said, "This has the consequence of masking SSL_CA_CERT_PATHif the latter file does not exist."

@bapt
Copy link
Member

bapt commented Jan 18, 2016

I first need to update libfetch to the latest version and see how this apply

@neirbowj
Copy link
Contributor Author

Two weeks ago I led myself to believe that pkg already has the latest version of libfetch, but I wouldn't swear to it now.

@bapt
Copy link
Member

bapt commented Jan 19, 2016

Merged thanks!

@bapt bapt closed this Jan 19, 2016
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.

None yet

2 participants