M
Matt Davies
If anyone can shed any light on what's going on here I'd be more than
grateful. I'm connecting to a BizTalk SOAP API and have been given a
self signed root certificate(certfile) from the windows box.
openssl verify certfile
certfile: /CN=UOG ESBDEV
error 18 at 0 depth lookup:self signed certificate
OK
ruby 1.9.2
rails 3.0.4,
httpclient (2.2.0)
httpi (0.9.2)
savon (0.9.1)
Mac OS X 10.6.7
OpenSSL 0.9.8l
curl 7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l
zlib/1.2.3
curl
This works as expected
curl --cacert certfile https://doodaa
If I don't supply the cacert, I get the error I would expect
curl: (60) SSL certificate problem, verify that the CA cert is OK.
Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify failed
openssl
This works as expected
openssl s_client -CAfile certfile -connect machinename:443
Altering the certfile, not specifying the certfile results in Verify
return code: 21 (unable to verify the first certificate)
httpclient
This works as expected
#!/usr/bin/env ruby
require 'rubygems'
require 'httpclient'
client = HTTPClient.new
client.ssl_config.set_trust_ca('certfile')
url = "https://doodaa"
resp = client.get(url)
puts resp.content
puts resp.status
If I edit the certfile or point to another certfile, it fails as I would
expect
httpi
This does not work as expected
#!/usr/bin/env ruby
require 'rubygems'
require 'httpi'
request = HTTPI::Request.new
request.url = "https://doodaa"
request.auth.ssl.cert_file = "certfile"
request.auth.ssl.verify_mode = eer
response = HTTPI.get request
puts response.body
Fails with
D, [2011-04-13T13:04:18.475665 #5711] DEBUG -- : HTTPI executes HTTP GET
using the httpclient adapter
at depth 0 - 20: unable to get local issuer certificate
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:276:in
`connect': SSL_connect returned=1 errno=0 state=SSLv3 read server
certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:276:in
`ssl_connect'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:712:in
`block in connect'
from
/Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:57:in
`timeout'
from
/Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:87:in
`timeout'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:704:in
`connect'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:568:in
`query'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:158:in
`query'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:1041:in
`do_get_block'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:850:in
`block in do_request'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:937:in
`protect_keep_alive_disconnected'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:849:in
`do_request'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:737:in
`request'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:642:in
`get'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi/adapter/httpclient.rb:24:in
`block in get'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi/adapter/httpclient.rb:64:in
`do_request'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi/adapter/httpclient.rb:23:in
`get'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi.rb:86:in
`block in get'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi.rb:189:in
`with_adapter'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi.rb:84:in
`get'
from httpitest.rb:19:in `<main>'
I've tried Rolle's solution he outlines here,
https://github.com/rubiii/httpi/issues/26 and edited this file
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi/adapter/httpclient.rb
Still get the same error
If anyone has any ideas I'm all ears
Any help, greatly appreciated.
grateful. I'm connecting to a BizTalk SOAP API and have been given a
self signed root certificate(certfile) from the windows box.
openssl verify certfile
certfile: /CN=UOG ESBDEV
error 18 at 0 depth lookup:self signed certificate
OK
ruby 1.9.2
rails 3.0.4,
httpclient (2.2.0)
httpi (0.9.2)
savon (0.9.1)
Mac OS X 10.6.7
OpenSSL 0.9.8l
curl 7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l
zlib/1.2.3
curl
This works as expected
curl --cacert certfile https://doodaa
If I don't supply the cacert, I get the error I would expect
curl: (60) SSL certificate problem, verify that the CA cert is OK.
Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify failed
openssl
This works as expected
openssl s_client -CAfile certfile -connect machinename:443
Altering the certfile, not specifying the certfile results in Verify
return code: 21 (unable to verify the first certificate)
httpclient
This works as expected
#!/usr/bin/env ruby
require 'rubygems'
require 'httpclient'
client = HTTPClient.new
client.ssl_config.set_trust_ca('certfile')
url = "https://doodaa"
resp = client.get(url)
puts resp.content
puts resp.status
If I edit the certfile or point to another certfile, it fails as I would
expect
httpi
This does not work as expected
#!/usr/bin/env ruby
require 'rubygems'
require 'httpi'
request = HTTPI::Request.new
request.url = "https://doodaa"
request.auth.ssl.cert_file = "certfile"
request.auth.ssl.verify_mode = eer
response = HTTPI.get request
puts response.body
Fails with
D, [2011-04-13T13:04:18.475665 #5711] DEBUG -- : HTTPI executes HTTP GET
using the httpclient adapter
at depth 0 - 20: unable to get local issuer certificate
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:276:in
`connect': SSL_connect returned=1 errno=0 state=SSLv3 read server
certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:276:in
`ssl_connect'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:712:in
`block in connect'
from
/Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:57:in
`timeout'
from
/Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:87:in
`timeout'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:704:in
`connect'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:568:in
`query'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient/session.rb:158:in
`query'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:1041:in
`do_get_block'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:850:in
`block in do_request'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:937:in
`protect_keep_alive_disconnected'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:849:in
`do_request'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:737:in
`request'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpclient-2.2.0/lib/httpclient.rb:642:in
`get'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi/adapter/httpclient.rb:24:in
`block in get'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi/adapter/httpclient.rb:64:in
`do_request'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi/adapter/httpclient.rb:23:in
`get'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi.rb:86:in
`block in get'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi.rb:189:in
`with_adapter'
from
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi.rb:84:in
`get'
from httpitest.rb:19:in `<main>'
I've tried Rolle's solution he outlines here,
https://github.com/rubiii/httpi/issues/26 and edited this file
/Users/me/.rvm/gems/ruby-1.9.2-p180@rails3httpi/gems/httpi-0.9.2/lib/httpi/adapter/httpclient.rb
Still get the same error
If anyone has any ideas I'm all ears
Any help, greatly appreciated.