History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-2178
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Ola Bini
Reporter: Mike Hogan
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JRuby

Received fatal alert: illegal_parameter (OpenSSL::SSL::SSLError)

Created: 26/Feb/08 06:00 AM   Updated: 14/Aug/08 04:51 AM
Component/s: OpenSSL
Affects Version/s: JRuby 1.1RC2
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
Installed and configured the rubyforge gem.
Did this:

gem install jruby-openssl

Then Did this:

rubyforge login

and got this exception:

/Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:1363:in `connect': Received fatal alert: illegal_parameter (OpenSSL::SSL::SSLError)
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:1351:in `timeout'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/1.8/timeout.rb:52:in `timeout'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:1351:in `connect'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:1351:in `query'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:892:in `query'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:434:in `do_get_block'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:370:in `conn_request'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:285:in `request'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:264:in `post'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:245:in `post_content'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:244:in `retry_connect'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:244:in `post_content'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/http-access2.rb:244:in `run'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib/rubyforge.rb:336:in `login'
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/bin/rubyforge:174
from /Users/mikehogan/projects/tools/jruby-1.1RC2/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/bin/rubyforge:138:in `load'
from /Users/mikehogan/tools/jruby-1.1RC2/bin/rubyforge:19

which was caused by this (truncated) java stack trace

javax.net.ssl.SSLException: Received fatal alert: illegal_parameter
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:166)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1356)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1324)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1486)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:961)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:787)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:663)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
at org.jruby.ext.openssl.SSLSocket.readAndUnwrap(SSLSocket.java:339)
at org.jruby.ext.openssl.SSLSocket.doHandshake(SSLSocket.java:248)
at org.jruby.ext.openssl.SSLSocket.connect(SSLSocket.java:174)
at org.jruby.ext.openssl.SSLSocketInvoker$connect_F0.call(Unknown Source)
at org.jruby.runtime.callback.FastInvocationCallback.execute(FastInvocationCallback.java:55)
at org.jruby.internal.runtime.methods.SimpleCallbackMethod.call(SimpleCallbackMethod.java:67)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:166)
at org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:301)
at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:657)
at org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:308)
at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:166)
at org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:301)
at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:657)
at org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:308)
at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:154)
at org.jruby.runtime.Block.yield(Block.java:114)

Take care,
Mike



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter - 27/Feb/08 09:34 PM
This seems to be a problem where registering the BC provider might fix it. See some of the following links:

http://forum.java.sun.com/thread.jspa?threadID=306461&messageID=1222156

Another lists this:

  • SSL/TLS protocol Alert description "ILLEGAL_PARAMETER" (47). Alert level: fatal. Indicates that a handshake message contains an illegal field.

So in theory, is there just a handshake incompatibility? A parameter not being accepted? Perhaps BC is not getting registered correctly, and something coming off the wire needs it?


Mike Hogan - 28/Feb/08 03:39 AM
It looks like BC is getting registered correctly, at least its on the classpath anyway:

5acff51a:~ mikehogan$ jirb
irb(main):001:0> require 'openssl'
=> true
irb(main):002:0> include_class 'org.bouncycastle.x509.X509V3CertificateGenerator'
=> ["org.bouncycastle.x509.X509V3CertificateGenerator"]
irb(main):003:0>

I'm totally out of my depth when it comes to diagnosing handshake problems, so I'll just let it brew for a while and see what comes up


Ola Bini - 13/Aug/08 09:04 AM
Well now, isn't this interesting? This bug actually seems to be tightly connected to JRUBY-1307. Rubyforge sets a cipher string and my guess is that I don't handle that correctly in the SSL context, which means nothing gets decided for cipher, and everything blows up. I have a smaller test case for it too.

Ola Bini - 13/Aug/08 11:25 AM
This has been fixed on OpenSSL trunk by implementing Cipher Strings more correctly in SSLContext.