Open hotgazpacho opened 8 years ago
I'm seeing something similar on CentOS 6.
$ ruby -r httpclient -e "puts HTTPClient.new.get_content('https://ertw.nationbuilder.com')"
/home/campaign/.gem/ruby/2.2.3/gems/httpclient-2.8.2.4/lib/httpclient/ssl_socket.rb:46:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
If I overwrite the gem's certificate bundle it works:
cp /etc/pki/tls/cert.pem /home/campaign/.gem/ruby/2.2.3/gems/httpclient-2.8.2.4/lib/httpclient/cacert.pem
Hi @swalberg ,
I am facing the same issue, and here is the root cause for my case: the httpclient forces to use RSA 2048bit CA cert set since the commit https://github.com/nahi/httpclient/commit/b9bb08fdfec46b4a18c9af16630cfef4f553542d
Also the fix to to call HTTPClient.new.ssl_config.set_default_paths
because set_default_paths
will use OS's trusted CA certificates.
Thanks @shawzt. I didn't realize set_default_paths
was an option. I ended up using
http_client.ssl_config.add_trust_ca CA_BUNDLE_LOCATION if CA_BUNDLE_LOCATION
Updates on this?
HTTPClient does not honor OpenSSL's certificate dir configuration. Specifically, I have a couple of certificates, issued by a company's CA and trusted by my system, that I explicitly wish for Ruby http clients to trust. So, I put them in the directory that OpenSSL expects them to be in (which, according to my ruby installation, is
/usr/local/etc/openssl/certs
):Net::HTTP
trusts these certificates:HTTPClient does not:
HTTPClient, upon which the openid_connect gem sits (via rack-oauth2, swd, and webfinger), should honor the Ruby OpenSSL configuration.