- Previous thread: * operator, Float
- Next thread: Module inclusion and class macro problem
- Threads sorted by date: ruby 201007
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
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
Related Threads
- dictionary and list - python
- Density statistic calculation in case of histogram - oracle
- O teu amor me fais falta...! - openbsd
- اضغط على الصوره الذى دخل عليها اكثر من8 مليون شخص حتى الأن - ruby
- GCHK price up more than 20%, Obama's stimulus package creates massive growth - freebsd
- problem with if_re on RELENG_7 - freebsd
- [users] User-eMail - openoffice
- DO NOT REPLY [Bug 47053] New: org.apache.catalina.loader.WebAppClassLoader.getResources returns two resource URLs for identical - tomcat
- Summer of Code 2009 - django
- Postfix Mail Loop - postfix
- daily NetBSD-5 branch CVS update output - netbsd
- Get title from URL? - ruby