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

Key: JRUBY-2151
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Ola Bini
Reporter: Igor Minar
Votes: 1
Watchers: 8
Operations

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

un-implemented method called PKCS7#read_smime

Created: 19/Feb/08 08:35 PM   Updated: 12/Aug/08 11:07 AM
Component/s: OpenSSL
Affects Version/s: JRuby 1.0.3, JRuby 1.1RC2
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
Currently it is not possible to use Soap4R with a webservice that requires HTTPS (e.g. very common use case is an authentication webservice).
NoMethodError: undefined method `data' for nil:NilClass
	from /Users/x/jruby-1.1RC2/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:390:in `load_cacerts'
	from /Users/x/jruby-1.1RC2/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:386:in `initialize'
	from /Users/x/jruby-1.1RC2/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:1744:in `new'
	from /Users/x/jruby-1.1RC2/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:1744:in `initialize'
	from /Users/x/x/././script/../config/../config/../vendor/gems/soap4r-1.5.6/lib/soap/streamHandler.rb:115:in `new'
	from /Users/x/x/././script/../config/../config/../vendor/gems/soap4r-1.5.6/lib/soap/streamHandler.rb:115:in `initialize'
	from /Users/x/x/././script/../config/../config/../vendor/gems/soap4r-1.5.6/lib/soap/streamHandler.rb:110:in `new'
	from /Users/x/x/././script/../config/../config/../vendor/gems/soap4r-1.5.6/lib/soap/streamHandler.rb:110:in `create'
	from /Users/x/x/././script/../config/../config/../vendor/gems/soap4r-1.5.6/lib/soap/rpc/proxy.rb:212:in `initialize_streamhandler'
	from /Users/x/x/././script/../config/../config/../vendor/gems/soap4r-1.5.6/lib/soap/rpc/proxy.rb:50:in `initialize'
	from /Users/x/x/././script/../config/../config/../vendor/gems/soap4r-1.5.6/lib/soap/rpc/driver.rb:115:in `new'
	from /Users/x/x/././script/../config/../config/../vendor/gems/soap4r-1.5.6/lib/soap/rpc/driver.rb:115:in `initialize'

It looks like the problem is in jruby-opessl library and a method that it doesn't implement.

The only workaround I know about is to use a Java Integration and communicate with the service via a java web service stub. This however represents a considerable performance penalty.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Igor Minar - 19/Feb/08 08:38 PM
oops.. I missed the first line that I see in the logs:
WARNING: un-implemented method called PKCS7#read_smime
NoMethodError: undefined method `data' for nil:NilClass
	from /Users/x/jruby-1.1RC2/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:390:in `load_cacerts'

...
...
...

Charles Oliver Nutter - 24/Feb/08 10:39 PM
Any way you can come up with a test case for this? It's a tricky one to debug without.

Mike Auclair - 28/Feb/08 10:18 AM
I am having this issue as well, I receive it as soon as I call SOAP::WSDLDriverFactory.new(wsdl_url), whereby wsdl_url is an https URL.

WARNING: un-implemented method called PKCS7#read_smime
NoMethodError: undefined method `data' for nil:NilClass
from /web/jruby/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:390:in `load_cacerts'
from /web/jruby/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:386:in `initialize'
from /web/jruby/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:1744:in `new'
from /web/jruby/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:1744:in `initialize'
from /web/jruby/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:66:in `new'
from /web/jruby/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:66:in `fetch'
from /web/jruby/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:36:in `import'
from /web/jruby/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ext/object.rb:93:in `handle_different_imports'
from /web/jruby/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import'
from /web/jruby/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb:146:in `import'
from /web/jruby/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ext/object.rb:93:in `handle_different_imports'
from /web/jruby/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb:32:in `initialize'
------------- The call to SOAP::WSDLDriverFactory.new ----------------
from /web/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27
from /web/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /web/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /web/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `new_constants_in'
from /web/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:318:in `require'
from /web/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require_or_load'
from /web/rails/OSOW/vendor/plugins/en>> gines/lib/engines/rails_extensions/dependencies.rb:139:in `require_or_load_with_engine_additions'
from /web/rails/OSOW/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb:101:in `load_missing_constant'
from /web/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in `const_missing'
from /web/jruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:464:in `const_missing'


Britt Crawford - 13/Mar/08 03:07 PM
This issue also seems to be affecting non-SSL web services using SOAP4R 1.5.8 as well. I get the same error when trying to connect to an unsecured web service.

I've attach a patch for httpclient-2.1.2 that simply adds a nil? check to HTTPClient's certificate loading method and allows you to access regular HTTP web services using SOAP4R-1.5.8. However, it does nothing to fix the PKCS7.read_smime problem.

===================================================================
— lib/httpclient.rb (revision 191)
+++ lib/httpclient.rb (working copy)
@@ -387,7 +387,7 @@
selfcert = OpenSSL::X509::Certificate.new(dist_cert)
store = OpenSSL::X509::Store.new
store.add_cert(selfcert)

  • if (p7.verify(nil, store, p7.data, 0))
    + if (!p7.nil? && p7.verify(nil, store, p7.data, 0))
    set_trust_ca(file)
    else
    STDERR.puts("cacerts: #{file} loading failed")

Carl Bourne - 27/May/08 09:56 AM
Hi,

I'm also experiencing the same problem - any idea as to when it may be fixed?

==============================================================

WARNING: un-implemented method called PKCS7#read_smime
/Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:390:in `load_cacerts': undefined method `data' for nil:NilClass (NoMethodError)
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:163:in `initialize'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:1744:in `new'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:1744:in `initialize'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:145:in `new'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:145:in `initialize'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:140:in `new'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:140:in `create'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:213:in `initialize_streamhandler'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:51:in `initialize'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:116:in `new'
from /Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ruby2/jruby-1.1/lib/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:116:in `initialize'
from /Users/cbourne/NetBeansProjects/PGP Service Tester/lib/main.rb:38:in `new'
from /Users/cbourne/NetBeansProjects/PGP Service Tester/lib/main.rb:38


Nick Sieger - 28/May/08 09:47 AM
We've been able to use soap4r to communicate with https soap webservices, but you need to force soap4r to use net/http instead of httpclient. We've also been frozen at an earlier version of soap4r, having had some difficulties with upgrades.

The basic formula we've been using is:

  • soap4r-1.5.6.90.20070704
  • No http-access2 or httpclient library installed or available on the load path

You may want the following code to ensure that net/http is used. It is also in the streamHandler.rb file, but can be used just in case http-access2 gets picked up accidentally.

require 'soap/streamHandler'

class HTTPStreamHandler
  require 'soap/netHttpClient'
  # Ruby will warn about re-assigning to constants
  # Use ActiveSupport's silence_stderr and Object#const_set if you don't want them to appear
  Client = SOAP::NetHttpClient
  RETRYABLE = false
end

Ola Bini - 30/May/08 11:43 AM
I'm going to create a new bug for PKCS7, since there are lots of things that need to be done to get it to work. First task, write some tests. Ouch.

Ola Bini - 12/Aug/08 09:13 AM
There is still not any executable test cases for this one. To verify that it's actually resolved, that would be necessary. I will resolve this, and a new bug can be filed if anything else needs to be fixed.

Ola Bini - 12/Aug/08 09:15 AM
read_smime have been implemented and will soon be released in a new OpenSSL version. If any other problem exists with soap4r, they should have separate bugs reported.

Igor Minar - 12/Aug/08 11:07 AM
This is a fantastic news. I can help to test the code. Just let me know when the new bits are available.