Test for /etc/ssl/cert.pem existence to avoid masking SSL_CA_CERT_PATH #1368
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this patch, unless
SSL_CA_CERT_FILEis 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 maskingSSL_CA_CERT_PATH, because OpenSSL will ignore the CA path if a CA file is set but fails to load (seeX509_STORE_load_locations()).While here, fall back to OpenSSL defaults if neither
SSL_CA_CERT_FILEnorSSL_CA_CERT_PATHare 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.