开发者

How to use SSL Web Services in a Rails application

I having a hard time to consume this webservice https://www.arello.com/webservice/verify.cfc?wsdl in my rails application. I successfully generated the ruby files with the wsdl2ruby.rb but when un run the generated script I get the following error:

at depth 0 - 20: unable to get local issuer certificate
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 re开发者_运维问答ad server certificate B: certificate verify failed

I also tried to connect via this script but same issue

require 'http-access2'
client = HTTPAccess2::Client.new()
client.ssl_config.set_trust_ca('/arello.cert')
puts client.get('https://www.arello.com/webservice/verify.cfc?wsdl').content

Any ideas? Thanks


The easy way to get around this is to just turn off SSL Cert verification. You can do this with the ssl_config options. Example from your second script:

require 'http-access2'
client = HTTPAccess2::Client.new()
client.ssl_config.verify_mode=OpenSSL::SSL::VERIFY_NONE
puts client.get('https://www.arello.com/webservice/verify.cfc?wsdl').content
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜