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

Fix CA configuration by SSL_CERT_DIR #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

febeling
Copy link

The environment variable SSL_CERT_DIR is documented to configure an
alternative trust CA.

This expected behavior is documented in the SSLConfig module here. It doesn't take effect, though. When searching the library's code for SSL_CERT_DIR it doesn't occur.

This setting is important in cases when a user wants to use a debug proxy, the connection is encrypted, and the client code doesn't use httpclient directly, but through third-party API SDKs, e.g. the google-cloud-storage gem.

Fixes #369

@febeling
Copy link
Author

Note there is an alternative PR for this bug in #386.

@febeling
Copy link
Author

Test failures are unrelated to this change. The above mentioned PR states that test failures of master are due to expired fixture certificates.

I'll keep this change deliberately narrow, only fixing the problem at hand.

@febeling febeling changed the title Fix CA configuration by environment variable Fix CA configuration by environment variable SSL_CERT_DIR Dec 28, 2018
@febeling febeling changed the title Fix CA configuration by environment variable SSL_CERT_DIR Fix CA configuration by SSL_CERT_DIR Dec 28, 2018
@febeling
Copy link
Author

@nahi Any thoughts on this fix?

The environment variable `SSL_CERT_DIR` is documented to configure an
alternative trust CA, but that wasn't used before; fixed.
@febeling febeling force-pushed the fix_ca_config_by_env_var branch from 86fcb4f to fed578a Compare March 12, 2019 11:11
@vfazio
Copy link

vfazio commented Jul 15, 2019

bump, would be good to get this in as it affects other gems, such as OpenIDConnect when attempting to perform discovery

tigefa4u pushed a commit to tigefa4u/gitlabhq that referenced this pull request Jul 15, 2019
By default, httpclient (and hence anything that uses rack-oauth2)
ignores the system-wide SSL certificate configuration in favor of its
own `cacert.pem`. This makes it impossible to use custom certificates
without patching that file. Until
nahi/httpclient#402 is merged, we work around
this limitation by forcing the `HTTPClient` SSL store to use the default
system configuration.

Closes https://gitlab.com/charts/gitlab/issues/1436
@febeling
Copy link
Author

febeling commented Dec 6, 2020

@nahi Please let me know if I can close, or if there's interest.

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.

SSL_CERT_FILE environment variable is not honoured
2 participants