Forum: JRuby OpenSSS load bug still ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2d1b64aaf61046ad166db3009fa8c7dc?d=identicon&s=25 unknown (Guest)
on 2012-11-11 20:49
(Received via mailing list)
hi newbie to this group, first post. I'm evaluating jruby for our
organization.

I encounter an error in trying to load net/smtp i.e.

require "net/smtp"

the above is literally all that I have in the file.

it complains about a openssl error , here's the stack:

/Library/Frameworks/JRuby.framework/Versions/1.7.0/bin/jruby --1.9 -e
$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
/Users/charles/IdeaProjects/Ruby/DataUploader/src/bin/test_smtp_load.rb
OpenSSL::X509::StoreError: setting default path failed: the
trustAnchors parameter must be non-empty
   set_default_paths at org/jruby/ext/openssl/X509Store.java:162
          SSLContext at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/1.9/openssl/ssl-internal.rb:31
                 SSL at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/1.9/openssl/ssl-internal.rb:22
             OpenSSL at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/1.9/openssl/ssl-internal.rb:21
              (root) at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/1.9/openssl/ssl-internal.rb:20
             require at org/jruby/RubyKernel.java:1019
              (root) at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/shared/rubygems/custom_require.rb:1
             require at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/shared/rubygems/custom_require.rb:36
             require at org/jruby/RubyKernel.java:1019
              (root) at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/1.9/openssl.rb:22
              (root) at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/shared/rubygems/custom_require.rb:1
             require at org/jruby/RubyKernel.java:1019
             require at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/shared/rubygems/custom_require.rb:36
              (root) at
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/ruby/1.9/net/smtp.rb:26
                load at org/jruby/RubyKernel.java:1045
              (root) at -e:1

Process finished with exit code 1


the gem jruby-openssl was installed succesfully.

I find old openssl issues on the forums  but can't find anything that
addresses this?

Any help is appreciated.

thanks
2d1b64aaf61046ad166db3009fa8c7dc?d=identicon&s=25 unknown (Guest)
on 2012-11-11 21:31
(Received via mailing list)
Just encountered something interesting and that's the fact that on My
Windows 7 64 bit box I don't encounter this issue at all. So there's
something taking place on my Mac OS X box that is causing this. I had
downloaded the Jruby 64 + jre dmg package and setup that sdk under my
Idea project. I had also used rvm to install jruby-head but that's not
the sdk configured for the project.

In the case of windows I had downloaded the exe+jre installer, it works
without a hitch.

-Charles
F1d37642fdaa1662ff46e4c65731e9ab?d=identicon&s=25 Charles Nutter (headius)
on 2012-11-12 01:32
(Received via mailing list)
This issue usually indicates a non-official or incomplete distribution
of OpenJDK/OracleJDK. Perhaps you can install the same JDK you're
using on the 64-bit system?

- Charlie
2d1b64aaf61046ad166db3009fa8c7dc?d=identicon&s=25 unknown (Guest)
on 2012-11-12 06:03
(Received via mailing list)
the installs on both the Win box where it works and the Mac Os x box
were via the installers provided by jruby.org

here's what I get when I run jruby --version :

jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on OpenJDK 64-Bit Server VM
1.7.0-internal-b00 [darwin-x86_64]

I'm also having issues debugging rspec tests and just plain debugging
but I figure I ask Intellij about those first.

I don't have any issues with this using RMI so perhaps a Java setup
thing I'm missing ?

thanks

-Charles
6a07e1b5f02cf61303cd2c3e97618a84?d=identicon&s=25 Chandra Mohan Thakur (cmthakur)
on 2015-06-18 08:06
If you are facing this problem then download
http://curl.haxx.se/ca/cacert.pem   and export to your bash_profile

`export SSL_CERT_FILE=PATH_TO_THe_DOWNLOADED_FILE/cacert.pem`

This works for me.
This topic is locked and can not be replied to.