I've installed JRuby's latest version (9.1.13.0) with RVM's latest version (1.29.3) on CentOS 7.4
Everything works fine but HTTPS and SSL connections failed with below error:
OpenSSL::SSL::SSLError: certificate verify failed
from org/jruby/ext/openssl/SSLSocket.java:228:in `connect_nonblock'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/net/http.rb:938:in `connect'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/net/http.rb:868:in `do_start'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/net/http.rb:857:in `start'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/open-uri.rb:319:in `open_http'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/open-uri.rb:737:in `buffer_open'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/open-uri.rb:212:in `block in open_loop'
from org/jruby/RubyKernel.java:1114:in `catch'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/open-uri.rb:210:in `open_loop'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/open-uri.rb:151:in `open_uri'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/open-uri.rb:717:in `open'
from /usr/local/rvm/rubies/jruby-9.1.13.0/lib/ruby/stdlib/open-uri.rb:35:in `open'
I've tried reinstalling OpenSSL and ca-certificates and RVM and JRuby. Also, I've tried to replace the cert file with a manually downloaded file, but nothing worked.
Update: I've tested my problem with doctor.rb:
export SSL_CERT_DIR='/etc/pki/tls/certs/' ; ruby doctor.rb www.google.com:443
and got:
/usr/local/rvm/rubies/jruby-9.1.13.0/bin/jruby (2.3.3) JRuby-OpenSSL
0.9.21: /etc/ssl SSL_CERT_DIR="/etc/pki/tls/certs/" SSL_CERT_FILE="/etc/pki/tls/certs/ca-bundle.crt"
HEAD https://www.google.com:443 OpenSSL::SSL::SSLError: certificate
verify failed
The server presented a certificate that could not be verified:
subject: /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA issuer:
/C=US/O=Equifax/OU=Equifax Secure Certificate Authority error code
20: unable to get local issuer certificate
Update 2:
The interesting point is that test of SSL connectivity for other servers like www.facebook.com
and www.apple.com
works OK!