Coder Social home page Coder Social logo

jruby-ossl's Introduction

jruby-ossl's People

Contributors

headius avatar jjb avatar mkristian avatar nahi avatar nicksieger avatar olabini avatar owenthereal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jruby-ossl's Issues

0.7.3 doesn't work with older versions of jruby

I attempted to upgrade form 0.7.2 to 0.7.3 under jruby 1.5.1. I now get the exception below.

I'll be upgrading to 1.6 soon so it's not a priority for me but I thought I would let you know.

Java::JavaLang::NoSuchMethodError: org.jruby.Ruby.getSelectorPool()Lorg/jruby/util/io/SelectorPool;
from org.jruby.ext.openssl.SSLSocket.waitSelect(SSLSocket.java:259)
from org.jruby.ext.openssl.SSLSocket.doHandshake(SSLSocket.java:313)
from org.jruby.ext.openssl.SSLSocket.connect(SSLSocket.java:170)
from org.jruby.ext.openssl.SSLSocket$i_method_0_0$RUBYINVOKER$connect.call(org/jruby/ext/openssl/SSLSocket$i_method_0_0$RUBYINVOKER$connect.gen:65535)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:289)

JRuby-openssl breaks Ruby MRI

Hey!

I do my development in Ruby MRI (1.9.3-p0) and deploy using JRuby. This has worked fine so far but since a few days ago this is no longer working - which I highly believe is due to JRuby-openssl 0.7.5.

When I run rails console, run a rake task etc I get the following error: https://gist.github.com/0f012595f60e7bf71f67 .

Somehow JRuby-openssl is loaded even though it's MRI and can't locate jopenssl (jruby-openssl-0.7.5/lib/shared/openssl.rb:10 ).

Steps to reproduce:

  1. rvm use 1.9.3-p0@jruby_bug_test --create
  2. gem install rails
  3. rails new jruby_bug_test && cd jruby_bug_test
  4. Use the following Gemfile: https://gist.github.com/5164e2e2dd24e380b9fd
  5. rm -rf Gemfile.lock && bundle install
  6. rails console

It's the gem majestic_seo_api that's pulling in JRuby-openssl. See it's Gemfile here: https://gist.github.com/251be3c1ca1badebd9d3

Is this just happening for me or anyone else doing dev on MRI and deploys on JRuby running into this issue?

X509Cert.set_serial breaks for Certificate SerialNumbers with MSB=1

in X509Cert.java line 303, set_serial makes a call to org.bouncycastle.x509.X509V3CertificateGenerator.setSerialNumber(BigInteger), which throws an exception if given a negative number.

Sample stacktrace:
Java::JavaLang::IllegalArgumentException (serial number must be a positive integer):
org.bouncycastle.x509.X509V3CertificateGenerator.setSerialNumber(Unknown Source)
org.jruby.ext.openssl.X509Cert.set_serial(X509Cert.java:303)
org.jruby.ext.openssl.X509Cert.initialize(X509Cert.java:166)
org.jruby.ext.openssl.X509Cert$i$0$1$initialize.call(X509Cert$i$0$1$initialize.gen:65535)
...

( refer to http://bouncycastle.sourcearchive.com/documentation/1.43/classorg_1_1bouncycastle_1_1x509_1_1X509V3CertificateGenerator_23c047ee3c96cb63a0f42cace5333b7b.html )

During initialization, such a certificate with a serial number having MSB=1 can be loaded via java java.security.cert.X509Certificate (line 158), this results in cert.getSerialNumber() (line 166) to yield a negative BigInteger due to it's internal 2's complement representation. Thus, a valid certificate can result in an error.

Typically, such a situation might arise from a certificate authority which generates serial numbers via UID (random bit generation) instead of an incremental approach. This results in a ~50% chance that the MSB=1, and causing this failure.
Eg, Serial number "d4 06 2d 6b c9 84 48 86 3d ea c2 cd c1 37 86 8a" (any serial where the first hex digit is 8-f)

The fix is simple, just make sure that the bouncycastle code does not receive a negative SerialNumber. This can be done by forcing BigInteger to interpret the serialNumber bits as positive number by setting the signum in the constructor, as follows:

X509Cert.java:303
-generator.setSerialNumber(bi);
+generator.setSerialNumber(new BigInteger(1, bi.toByteArray()));

note: This is difficult to reproduce using certificates generated via openssl CA, since it seems to pad the serial with extra 0s for MSB, neatly avoiding the problem.

Thank you

Error establishing SSL connections: OpenSSL::SSL::SSLError: Socket closed

(Also logged this here: http://jira.codehaus.org/browse/JRUBY-6346 -- wasn't sure the best place to put it)

Mac OSX Lion, jruby 1.6.5.1, 1.9 mode, jruby-openssl 0.7.5.dev

I have been intermittently seeing "SSLError: Socket closed" upon connect, trying to establish an SSL socket connection. Hard to tell whether it was just my connection or not. Then I noticed that it happens without fail upon accept when running WEBrick in https mode--except from Safari. I mean, Webrick starts up okay, but when I navigate to https://localhost:3000 in my browser (though, strangely, Safari works fine), it fails with the following backtrace:

<OpenSSL::SSL::SSLError: Socket closed>

org/jruby/ext/openssl/SSLSocket.java:227:in accept
/Users/mhauck/.rvm/gems/jruby-1.6.5.1/gems/jruby-openssl-0.7.5.1.dev.ibm/lib/1.9/openssl/ssl-internal.rb:164:in accept
/Users/mhauck/.rvm/rubies/jruby-1.6.5.1/lib/ruby/1.9/webrick/server.rb:159:in accept_client
/Users/mhauck/.rvm/rubies/jruby-1.6.5.1/lib/ruby/1.9/webrick/server.rb:94:in start
org/jruby/RubyArray.java:1612:in each
/Users/mhauck/.rvm/rubies/jruby-1.6.5.1/lib/ruby/1.9/webrick/server.rb:91:in start
/Users/mhauck/.rvm/rubies/jruby-1.6.5.1/lib/ruby/1.9/webrick/server.rb:22:in start
/Users/mhauck/.rvm/rubies/jruby-1.6.5.1/lib/ruby/1.9/webrick/server.rb:81:in start
/Users/mhauck/.rvm/gems/jruby-1.6.5.1/gems/rack-1.2.4/lib/rack/handler/webrick.rb:13:in run
/Users/mhauck/.rvm/gems/jruby-1.6.5.1/gems/rack-1.2.4/lib/rack/server.rb:217:in start
/Users/mhauck/.rvm/gems/jruby-1.6.5.1/gems/railties-3.0.10/lib/rails/commands/server.rb:65:in start
/Users/mhauck/.rvm/gems/jruby-1.6.5.1/gems/railties-3.0.10/lib/rails/commands.rb:30:in (root)
org/jruby/RubyKernel.java:1804:in tap
/Users/mhauck/.rvm/gems/jruby-1.6.5.1/gems/railties-3.0.10/lib/rails/commands.rb:27:in (root)
org/jruby/RubyKernel.java:1047:in require
script/rails:59:in (root)

The failure in connect comes from the following code (from jtv-apns gem):

context = OpenSSL::SSL::SSLContext.new
context.cert = cert
context.key = pem
sock = TCPSocket.new(host, port)
ssl = OpenSSL::SSL::SSLSocket.new(sock, context)
ssl.connect

PS. I configured webrick to use SSL as detailed here: http://www.nearinfinity.com/blogs/chris_rohr/configuring_webrick_to_use_ssl.html

OpenSSL::SSL::SSLError: Received fatal alert: bad_record_mac

When trying to retrieve a page from a SSL resource, the exception above is thrown, even though OpenSSL::SSL::VERIFY_NONE is set.

Environment:
OS X 10.6.6

$ jruby -v
jruby 1.5.5 (ruby 1.8.7 patchlevel 249) (2010-11-10 4bd4200) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_22) [x86_64-java]

$ jirb -v
irb 0.9.5(05/04/13)

 $ jruby -S gem list jruby-openssl

*** LOCAL GEMS ***

jruby-openssl (0.7.2)

$ jirb
~> Console extensions: wirble hirb ap rails2 rails3
jruby-1.5.5 :001 > require 'openssl'
 => true 
jruby-1.5.5 :002 > require 'net/https'
 => true 
jruby-1.5.5 :003 > 
jruby-1.5.5 :004 >   http = Net::HTTP.new 'msp.ibm.com', 443
 => # 
jruby-1.5.5 :005 > http.use_ssl = true
 => true 
jruby-1.5.5 :006 > http.verify_mode = OpenSSL::SSL::VERIFY_NONE
 => 0 
jruby-1.5.5 :007 > req = Net::HTTP::Get.new '/'
 => # 
jruby-1.5.5 :008 > http.request(req).body
OpenSSL::SSL::SSLError: Received fatal alert: bad_record_mac
    from /Users/charl/.rvm/rubies/jruby-1.5.5/lib/ruby/1.8/net/http.rb:586:in `connect'
    from /Users/charl/.rvm/rubies/jruby-1.5.5/lib/ruby/1.8/net/http.rb:553:in `do_start'
    from /Users/charl/.rvm/rubies/jruby-1.5.5/lib/ruby/1.8/net/http.rb:542:in `start'
    from /Users/charl/.rvm/rubies/jruby-1.5.5/lib/ruby/1.8/net/http.rb:1035:in `request'
    from (irb):8

exception for X509 signing

Hi,

i am getting some problems with OpenSSL::X509 in #jruby, I have a X509 request and a RSA, I am trying to sign the cert with the RSA and got exceptions:

r.class
=> OpenSSL::X509::Request
k.class
=> OpenSSL::PKey::RSA
r.sign(k, OpenSSL::Digest::SHA256.new)
Java::JavaLang::NullPointerException:
from org.jruby.RubyNumeric.other2long(RubyNumeric.java:205)
from org.jruby.RubyNumeric.num2long(RubyNumeric.java:200)
from org.jruby.RubyNumeric.fix2int(RubyNumeric.java:269)
from org.jruby.ext.openssl.Request.sign(Request.java:276)
from org.jruby.ext.openssl.Request$i$2$0$sign.call(Request$i$2$0$sign.gen:65535)

sending UTF-8 data over SSL can result in lost data

Not quite sure yet if this belongs here. Requests seem to hang over ssl when sending back data read from a file. The file contains a mix of single-byte UTF-8 characters and double-byte UTF-8 characters (all at the front in my example, but not in the real case). Over http it works fine, and the same app works in https and http in MRI.

Rack app:

require 'rack/utils'
require 'openssl'
require 'webrick'
require 'webrick/https'

class SslEncodingIssue
  def call(env)

    # file can be downloaded from https://gist.github.com/1947380
    out = File.read("gistfile1.txt")    

    headers = {}
    headers["Content-Length"] = [out].inject(0) { |l, p| l + Rack::Utils.bytesize(p) }.to_s
    headers["Content-Type"] = "text/html"

    [200, headers, [out]]
  end
end

pkey = OpenSSL::PKey::RSA.new(File.read("keypair.pem"))
cert = OpenSSL::X509::Certificate.new(File.read("cert.pem"))

Rack::Handler::WEBrick.run(
  SslEncodingIssue.new,
  :Port => 3000,
  :SSLEnable => true,
  :SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,
  :SSLCertificate => cert,
  :SSLPrivateKey => pkey,
  :SSLCertName => [ [ "CN",WEBrick::Utils::getservername ] ] 
)

Run rackup and ping http://localhost:3000/ - for me, the request hangs for a bit, and curl responds with: * transfer closed with 2 bytes remaining to read.

Change :SSLEnable = true to = :SSLEnable = false and hit the http url, and the problem goes away. I've put this test case into Webrick, but was having the same issue with other server.

Problem is very dependent on length of output - remove a few lines of dots and the issue does not occur.

Happy to provide more info!

OpenSSL::SSL::SSLSocket.new(s, @ssl_context) raises Exception ArgumentError occured, with wrong # of arguments(2 for 0)

hey guys, i'm gettiing a weird intermittent error within a ror app (using jruby-jars 1.5.3 and jruby-openssl 0.7.1) where around 5% of calls to the following line fail with the stack traces below (which complain that the initialize method's signature has changed... )

OpenSSL::SSL::SSLSocket.new(s, @ssl_context)

Stack trace 1:

2010-10-21 11:23:03,330 [TP-Processor401] {} INFO jruby.rack - Exception ArgumentError occured, with wrong # of arguments(2 for 0)
file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/net/http.rb:567:in initialize' file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/net/http.rb:567:innew'
file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/net/http.rb:567:in connect' file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/net/http.rb:553:indo_start'
file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/net/http.rb:542:in start' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/savon-0.7.9/lib/savon/request.rb:82:inwsdl' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/savon-0.7.9/lib/savon/wsdl.rb:122:in to_s' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/savon-0.7.9/lib/savon/wsdl.rb:131:instream' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/savon-0.7.9/lib/savon/wsdl.rb:94:in soap_actions' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/savon-0.7.9/lib/savon/wsdl.rb:110:inrespond_to?' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/savon-0.7.9/lib/savon/client.rb:92:in method_missing' /vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/app/models/sims/base.rb:25:ininvoke' /vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/app/models/sims/group.rb:41:in membership_operation' /vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/app/models/sims/group.rb:4:inadd_member' /vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/app/models/sims/job.rb:142:in process_group_membership' /vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/app/models/sims/job.rb:59:inprocess!' /vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/app/models/benchmarking.rb:6:in bm' file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/benchmark.rb:308:inrealtime'
/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/app/models/benchmarking.rb:6:in bm' /vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/app/models/sims/job.rb:57:inprocess!' /vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/app/controllers/scheduled_tasks_controller.rb:167:in provision_sims_requests' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:1331:inperform_action' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:617:in call_filters' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:610:inperform_action_with_filters' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in perform_action_with_benchmark' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:inms' file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/benchmark.rb:308:in realtime' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:inms' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in perform_action_with_benchmark' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/rescue.rb:160:inperform_action_with_rescue' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/flash.rb:151:in perform_action_with_flash' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:inprocess' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:606:in process_with_filters' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:391:inprocess' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:386:in call' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:438:incall' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:87:in dispatch' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:121:in_call' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:130:in build_middleware_stack' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:29:incall' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:29:in call' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/query_cache.rb:34:incache' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:9:in cache' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:28:incall' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in call' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/string_coercion.rb:25:incall' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/rack-1.1.0/lib/rack/head.rb:9:in call' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:incall' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/params_parser.rb:15:in call' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/session/cookie_store.rb:99:incall' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/failsafe.rb:26:in call' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/rack-1.1.0/lib/rack/lock.rb:11:incall' /vhosts/dw11570/content/current/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:106:in call' file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:36:inserve_rails'
file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:41:in call' file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:180:incall'
file:/vhosts/dw11570/content/20101015-142213/tomcat/webapps/iris3/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/handler/servlet.rb:19:in `call'

Stack trace 2:

ArgumentError: wrong # of arguments(2 for 0) at ticket#password
/vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/net-ldap-0.1.1/lib/net/ldap.rb:1145:in initialize' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/net-ldap-0.1.1/lib/net/ldap.rb:1145:innew' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/net-ldap-0.1.1/lib/net/ldap.rb:1145:in wrap_with_ssl' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/net-ldap-0.1.1/lib/net/ldap.rb:1183:insetup_encryption' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/net-ldap-0.1.1/lib/net/ldap.rb:1131:in initialize' [RAILS_ROOT]/lib/active_directory/base.rb:15:innew' [RAILS_ROOT]/lib/active_directory/base.rb:15:in connect' [RAILS_ROOT]/app/models/benchmarking.rb:6:inbm' file:/vhosts/dw11570/content/20101011-102342/t! omcat/webapps/iris3/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/benchmark.rb:308:in realtime' [RAILS_ROOT]/app/models/benchmarking.rb:6:inbm' [RAILS_ROOT]/lib/active_directory/base.rb:14:in connect' [RAILS_ROOT]/app/models/active_directory/person.rb:145:inset_initial_password' [RAILS_ROOT]/app/controllers/ticket_controller.rb:278:in password' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:1331:inperform_action' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:617:in call_filters' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:610:inperform_action_with_filters' /vhosts/dw11570/content/20101011-102342/contentsys/compiled! /tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in perform_action_with_benchmark' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:inms' file:/vhosts/dw11570/content/20101011-102342/tomcat/webapps/iris3/WEB-INF/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/benchmark.rb:308:in realtime' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:inms' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in perform_action_with_benchmark' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/rescue.rb:160:inperform_action_with_rescue' /vhosts/dw11570/content/! 20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/flash.rb:151:in perform_action_with_flash' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:inprocess' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:606:in process_with_filters' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:391:inprocess' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:386:in call' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/routing/rout! e_set.rb:438:incall' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:87:in dispatch' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:121:in_call' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:130:in build_middleware_stack' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:29:incall' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:29:in call' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/query! _cache.rb:34:incache' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:9:in cache' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:28:incall' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in call' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/string_coercion.rb:25:incall' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/rack-1.1.0/lib/rack/head.rb:9:in call' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/rack-1.1.0/l! ib/rack/methodoverride.rb:24:incall' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/params_parser.rb:15:in call' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/session/cookie_store.rb:99:incall' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/failsafe.rb:26:in call' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/rack-1.1.0/lib/rack/lock.rb:11:incall' /vhosts/dw11570/content/20101011-102342/contentsys/compiled/tomcat/webapps/iris3/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:106:in call' file:/vhosts/dw11570/content/20101011-102342/tomcat/webapps/iris3/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:36:inserve_rails'
file:/vhosts/dw11570/content/20101011-102342/! tomcat/webapps/iris3/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:41:in call' file:/vhosts/dw11570/content/20101011-102342/tomcat/webapps/iris3/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:180:incall'
file:/vhosts/dw11570/content/20101011-102342/tomcat/webapps/iris3/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/handler/servlet.rb:19:in `call'

emailAddress attribute in X509 cert doesn't return the right key

Hi,

Here is what I found out when generating a OpenSSL::X509::Name instance. The "emailAddress" field is turned into "Email" which is not the same as RubySpec:

>>  dn = [
?>           ["DC", "org"],
?>           ["DC", "ruby-lang"],
?>           ["CN", "GOTOU Yuuzou"],
?>           ["emailAddress", "[email protected]"],
?>           ["serialNumber", "123"],
?>         ]
=> [["DC", "org"], ["DC", "ruby-lang"], ["CN", "GOTOU Yuuzou"], ["emailAddress", "[email protected]"], ["serialNumber", "123"]]
>> name = OpenSSL::X509::Name.new(dn)
=> /DC=org/DC=ruby-lang/CN=GOTOU Yuuzou/Email=gotoyuzo@ruby-lang.org/SN=123
>> name.to_s
=> "/DC=org/DC=ruby-lang/CN=GOTOU Yuuzou/[email protected]/SN=123"

I assume this test will fail: https://github.com/jruby/jruby-ossl/blob/master/test/1.9/test_x509name.rb#L84

Thanks,
Owen

Test suite wrongly assumes localhost == 127.0.0.1

I'm getting the following test failures with jruby-ossl 0.7.7 because it assumes that localhost will translate to 127.0.0.1. On my IPv6 system, however, it translates to ::1. Indeed, changing the SERVER_ADDR in test_imaps to ::1 makes all tests pass, but obviously that won't work on a system where localhost does map to 127.0.0.1.

  1) Failure:
test_imaps_login(IMAPTest)
    [./test/test_imaps.rb:38:in `test_imaps_login'
     org/jruby/RubyKernel.java:2076:in `send'
     org/jruby/RubyArray.java:1615:in `each'
     org/jruby/RubyArray.java:1615:in `each']:
<Net::IMAP::ByeResponseError> exception expected but was
Class: <Errno::ECONNREFUSED>
Message: <"Connection refused - Connection refused">
---Backtrace---
org/jruby/ext/socket/RubyTCPSocket.java:121:in `initialize'
org/jruby/RubyIO.java:876:in `new'
org/jruby/ext/socket/RubyTCPSocket.java:147:in `open'
/usr/share/jruby/lib/ruby/1.8/net/imap.rb:888:in `initialize'
./test/test_imaps.rb:40:in `test_imaps_login'
./test/test_imaps.rb:92:in `imaps_test'
./test/test_imaps.rb:39:in `test_imaps_login'
./test/test_imaps.rb:38:in `test_imaps_login'
org/jruby/RubyKernel.java:2076:in `send'
org/jruby/RubyArray.java:1615:in `each'
org/jruby/RubyArray.java:1615:in `each'
---------------

  2) Failure:
test_imaps_unknown_ca(IMAPTest)
    [./test/test_imaps.rb:22:in `test_imaps_unknown_ca'
     org/jruby/RubyKernel.java:2076:in `send'
     org/jruby/RubyArray.java:1615:in `each'
     org/jruby/RubyArray.java:1615:in `each']:
<OpenSSL::SSL::SSLError> exception expected but was
Class: <Errno::ECONNREFUSED>
Message: <"Connection refused - Connection refused">
---Backtrace---
org/jruby/ext/socket/RubyTCPSocket.java:121:in `initialize'
org/jruby/RubyIO.java:876:in `new'
org/jruby/ext/socket/RubyTCPSocket.java:147:in `open'
/usr/share/jruby/lib/ruby/1.8/net/imap.rb:888:in `initialize'
./test/test_imaps.rb:24:in `test_imaps_unknown_ca'
./test/test_imaps.rb:92:in `imaps_test'
./test/test_imaps.rb:23:in `test_imaps_unknown_ca'
./test/test_imaps.rb:22:in `test_imaps_unknown_ca'
org/jruby/RubyKernel.java:2076:in `send'
org/jruby/RubyArray.java:1615:in `each'
org/jruby/RubyArray.java:1615:in `each'
---------------

  3) Failure:
test_imaps_with_ca_file(IMAPTest)
    [./test/test_imaps.rb:30:in `test_imaps_with_ca_file'
     org/jruby/RubyKernel.java:2076:in `send'
     org/jruby/RubyArray.java:1615:in `each'
     org/jruby/RubyArray.java:1615:in `each']:
Exception raised:
Class: <Errno::ECONNREFUSED>
Message: <"Connection refused - Connection refused">
---Backtrace---
org/jruby/ext/socket/RubyTCPSocket.java:121:in `initialize'
org/jruby/RubyIO.java:876:in `new'
org/jruby/ext/socket/RubyTCPSocket.java:147:in `open'
/usr/share/jruby/lib/ruby/1.8/net/imap.rb:888:in `initialize'
./test/test_imaps.rb:32:in `test_imaps_with_ca_file'
./test/test_imaps.rb:92:in `imaps_test'
./test/test_imaps.rb:31:in `test_imaps_with_ca_file'
./test/test_imaps.rb:30:in `test_imaps_with_ca_file'
org/jruby/RubyKernel.java:2076:in `send'
org/jruby/RubyArray.java:1615:in `each'
org/jruby/RubyArray.java:1615:in `each'
---------------

210 tests, 1460 assertions, 3 failures, 0 errors
rake aborted!
Command failed with status (1): [/usr/bin/jruby --1.8 -w -Ibuild_lib:lib/sh...]

OpenSSL::ASN1::Integer#value returns Bignum and not OpenSSL::BN

I encountered an error when running JRuby 1.6.5/1.6.4 with Capistrano: "(OpenSSL::PKey::DSAError: bad sig size)" I found this ticket filed with net-ssh http://net-ssh.lighthouseapp.com/projects/36253-net-ssh/tickets/18-bad-sig-size-opensslpkeydsaerror-with-jruby-151 that looked like a similar issue. I did some digging and saw the difference between JRuby and MRI was that the OpenSSL::ASN1::Integer#value method returns Bignum under JRuby versus the OpenSSL::BN in MRI. It looks like this is a problem in either jruby-openssl or possibly bouncycastle. I posted a workaround to the net-ssh ticket until this is fixed.

problem using oauth gem with jruby-openssl

The unit tests in test_rsa_sha1.rb for the oauth-0.3.6 gem fail when using jruby-openssl-0.5.2. This is traced down to the fact that

OpenSSL::PKey::RSA.new(IO.read(File.dirname(FILE) + "/keys/rsa.pem")

fails in an exception “Neither PUB key nor PRIV key” when the pem file’s contents is as below. Note that I tested that the pem file is OK since running (in cygwin)
openssl rsa -in rsa.pem -check -noout
outputs
RSA key ok

Any assistance would be greatly appreciated.

-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALRiMLAh9iimur8V
A7qVvdqxevEuUkW4K+2KdMXmnQbG9Aa7k7eBjK1S+0LYmVjPKlJGNXHDGuy5Fw/d
7rjVJ0BLB+ubPK8iA/Tw3hLQgXMRRGRXXCn8ikfuQfjUS1uZSatdLB81mydBETlJ
hI6GH4twrbDJCR2Bwy/XWXgqgGRzAgMBAAECgYBYWVtleUzavkbrPjy0T5FMou8H
X9u2AC2ry8vD/l7cqedtwMPp9k7TubgNFo+NGvKsl2ynyprOZR1xjQ7WgrgVB+mm
uScOM/5HVceFuGRDhYTCObE+y1kxRloNYXnx3ei1zbeYLPCHdhxRYW7T0qcynNmw
rn05/KO2RLjgQNalsQJBANeA3Q4Nugqy4QBUCEC09SqylT2K9FrrItqL2QKc9v0Z
zO2uwllCbg0dwpVuYPYXYvikNHHg+aCWF+VXsb9rpPsCQQDWR9TT4ORdzoj+Nccn
qkMsDmzt0EfNaAOwHOmVJ2RVBspPcxt5iN4HI7HNeG6U5YsFBb+/GZbgfBT3kpNG
WPTpAkBI+gFhjfJvRw38n3g/+UeAkwMI2TJQS4n8+hid0uus3/zOjDySH3XHCUno
cn1xOJAyZODBo47E+67R4jV1/gzbAkEAklJaspRPXP877NssM5nAZMU0/O/NGCZ+
3jPgDUno6WbJn5cqm8MqWhW1xGkImgRk+fkDBquiq4gPiT898jusgQJAd5Zrr6Q8
AO/0isr/3aa6O6NLQxISLKcPDk2NOccAfS/xOtfOz4sJYM3+Bs4Io9+dZGSDCA54
Lw03eHTNQghS0A==
-----END PRIVATE KEY-----

unimplemented method called SignerInfo#signed_time

Hi all,

Is there a reason for this method be unimplemented?
jruby-ossl / src / java / org / jruby / ext / openssl / PKCS7.java

Is there any intention to implement it? Anything I could do to help?

TIA,

Sandro

Missing OpenSSL::PKCS12

The MRI stdlib version of OpenSSL has PKCS12 support, but I don't see it in jruby-openssl.

JRuby 1.6.4 doesn't automatically find jruby-openssl 0.7.4

The short version:

jruby -S bundle install doesn't work when an https gemserver is referenced in the Gemfile, but
jruby -ropenssl -S bundle install works correctly.

Steps to reproduce:

  • Download the jruby-bin-1.6.4 tarball and extract it.
  • Execute jruby -v to verify the correct binary is referenced.
  • Update to the latest rubygems: jruby -S gem update --system. This currently installs 1.8.10. (It seems JRuby ships a patched version of rubygems 1.5.1, because this isn't supposed to work for 1.5.1.)
  • Install the latest bundler: jruby -S gem install bundler. This currently installs 1.0.18
  • Install jruby-openssl: jruby -S gem install jruby-openssl. This currently installs 0.7.4.
  • Verify the gem is installed: it is listed by jruby -S gem list
  • Execute jruby -S bundle install while the :source in the Gemfile points to a gemserver available via https. The following exception is now raised:
    LoadError: OpenSSL::SSL requires the jruby-openssl gem
                  (root) at $HOME/bin/jruby/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:8
                use_ssl= at $HOME/bin/jruby/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:124
          connection_for at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:317
                 request at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:368
              fetch_http at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:203
                    send at org/jruby/RubyKernel.java:2104
              fetch_path at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:231
              load_specs at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:258
              load_specs at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/maven_gemify.rb:72
                    list at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:231
                    each at org/jruby/RubyArray.java:1603
                    list at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:227
                    list at $HOME/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/maven_gemify.rb:63
    fetch_all_remote_specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:253
            remote_specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:234
                    each at org/jruby/RubyArray.java:1603
            remote_specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:231
             fetch_specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:165
                   specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:70
                   index at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:159
                    each at org/jruby/RubyArray.java:1603
                   index at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:158
                   build at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/index.rb:7
                   index at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:157
                 resolve at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:151
                   specs at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:90
       resolve_remotely! at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:85
                     run at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:41
                 install at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:8
                 install at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/cli.rb:220
                    send at org/jruby/RubyKernel.java:2092
                     run at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:21
             invoke_task at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118
                dispatch at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263
                   start at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386
                  (root) at $HOME/bin/jruby-1.6.4/lib/ruby/gems/1.8/gems/bundler-1.0.18/bin/bundle:13
                    load at org/jruby/RubyKernel.java:1063
                  (root) at $HOME/bin/jruby/bin/bundle:19
  • However, if you issue jruby -ropenssl -S bundle install, the command works just fine

In a tomcat container Jopenssl::Version can't be loaded

Hey, I hope one of you can help me with this. Basicly inside jruby-rack jopenssl/version.rb can't be found. It is on the server though, at the place it's supposed to be. When I try to open it through the command line, everything looks fine.

That the error message:

INFO: An exception happened during JRuby-Rack startup
load error: jopenssl -- java.lang.RuntimeException: (LoadError) no such file to load -- jopenssl/version

Full error gist is here: https://gist.github.com/1157043

Thanks in advance
Chris

OpenSSL::X509::Certificate.new(string) raises Exception ArgumentError occured, wrong number of arguments (1 for 0)

Hi,

I'm getting an argument error within a Rails (3.1.7) Application when I do this:
....
cert = OpenSSL::X509::Certificate.new(File.read(cert_file))
....

The error mesage is: wrong number of arguments (1 for 0)

But, the weird thing that the code works when I run it in an unit test:
require 'openssl'
require 'test/unit'

class TestCertificate < Test::Unit::TestCase
....
def test_load_cert
cert = OpenSSL::X509::Certificate.new(File.read(@cert_file))
assert_equal("Fri Aug 24 01:55:30 20011", cert.not_before.asctime)
....
end
end

I'm using JRuby v1.6.7.2 and jruby-openssl v0.7.7

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.