unknown_ca exception when using client certificate in net::https

by William (the Better one)on 2010-07-25T17:35:05+00:00
Hello All,
I have using net::https in an Jruby program to connect an SSL web site
required an client certificate. I got the required client certificate
and tested it in IE and Firefox. In both IE and Firefox, it works
fine. Then I tried to use it in my Jruby program by using net::https
library. Below is my code:
uri = URI.parse( "https://test.com/test2/request" )
ds-http = Net::HTTP.new uri.host, uri.port
ds-http.use-ssl = true
File.open( "client-cer.pem", 'rb' ) do |f|
keydata = f.read
ds-http.cert = OpenSSL::X509::Certificate.new(keydata)
ds-http.key = OpenSSL::PKey::RSA.new(keydata, nil)
ds-http.ca-file = CA-PATH
end
res = ds-http.start {|http| http.request(req, rqt) }
When I run it by using Jruby, I got below exception:
C:/atb/jruby-1.3.1/bin/../lib/ruby/1.8/net/protocol.rb:135:in
`rbuf-fill': Recei
ved fatal alert: unknown-ca (IOError)
from C:/atb/jruby-1.3.1/bin/../lib/ruby/1.8/net/protocol.rb:
134:in `rbuf
-fill'
If anybody have any idea would be great appreciated.
Thanks in advance,
Jim

Does it work in MRI? Also note that the active-merchant code uses CA's
if their code is any help demo-wise.
-r