Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Not A Bug
-
Affects Version/s: JRuby-OpenSSL 0.7
-
Fix Version/s: None
-
Component/s: OpenSSL
-
Labels:None
-
Environment:Linux
-
Number of attachments :
Description
You can reproduce this issue with the following code:
require 'open-uri'
open("https://medioh-studio.s3.amazonaws.com/").read
On MRI (1.8.7) I get this:
OpenURI::HTTPError: 403 Forbidden
Which is the expected error in this case. The SSL certificate is verified and the anticipated response code is returned from Amazon's servers.
On JRuby 1.5.1 I get this:
OpenSSL::SSL::SSLError: certificate verify failed
This error seems to occur regardless of what version of jruby-openssl is installed. Perhaps open-uri is doing some custom stuff here which is breaking?
Issue Links
- relates to
-
JRUBY-6140
Net::POP3 (and possibly other things) cannot verify certificate using JRE's trust anchors
-
It might be a known limitation of jruby-ossl.
open-uri tries to use OS's default trusted CA certs when you don't set one explicitly.
OS's default trusted CA certs are set when the bundled openssl lib is compiled. It may be /etc/pki/certs, /etc/ssl/certs, etc.
When your openssl is '/usr/bin/openssl', normally it is '/usr/lib/ssl/certs' (bin -> lib, openssl -> ssl).
And unfortunately jruby-ossl does not depend on bundled openssl so jruby-ossl cannot detect the default trusted CA certs.
Would you please try the following? You need to change '/etc/ssl/certs' part for your env.
% SSL_CERT_DIR=/etc/ssl/certs jruby -ropen-uri -e 'p open("https://medioh-studio.s3.amazonaws.com/")'