Savon SSL 问题

发布于 2024-11-16 09:52:15 字数 936 浏览 3 评论 0原文

我正在努力让 Savon gem 连接到我们的一台服务器。我不断收到错误消息,指出我无法通过 ssl。我读过很多教程和修复程序,但似乎都不起作用。

任何帮助表示赞赏 - 如果我能克服它,这将成为我的星期一:-)。

错误:

D, [2011-06-20T09:43:02.002993 #10328] DEBUG -- : Retrieving WSDL from: http://path_to_wsdl:4443/sm/services/mailing/2009/03/02?wsdl
D, [2011-06-20T09:43:02.129057 #10328] DEBUG -- : HTTPI executes HTTP GET using the httpclient adapter
/.rvm/gems/ruby-1.9.2-p0/gems/httpclient-2.2.1/lib/httpclient/session.rb:276:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert unexpected message (OpenSSL::SSL::SSLError)

我的代码:

require 'savon'

client = Savon::Client.new "path_to_my_wsdl"

client.http.auth.ssl.cert_file = "path/cert.pem"

client.http.auth.ssl.cert_key_file = "/path/localhost.key"
client.http.auth.ssl.verify_mode = :none

client.wsse.credentials "username", "password"

client.wsdl.soap_actions

I'm struggling to get the Savon gem to connect to one of our servers. I keep getting an error stating I can't get past the ssl. I've read numerous tutorials and fixes but none seem to work.

Any help appreciated - this will make my Monday if I can get past it :-).

Error:

D, [2011-06-20T09:43:02.002993 #10328] DEBUG -- : Retrieving WSDL from: http://path_to_wsdl:4443/sm/services/mailing/2009/03/02?wsdl
D, [2011-06-20T09:43:02.129057 #10328] DEBUG -- : HTTPI executes HTTP GET using the httpclient adapter
/.rvm/gems/ruby-1.9.2-p0/gems/httpclient-2.2.1/lib/httpclient/session.rb:276:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert unexpected message (OpenSSL::SSL::SSLError)

My code:

require 'savon'

client = Savon::Client.new "path_to_my_wsdl"

client.http.auth.ssl.cert_file = "path/cert.pem"

client.http.auth.ssl.cert_key_file = "/path/localhost.key"
client.http.auth.ssl.verify_mode = :none

client.wsse.credentials "username", "password"

client.wsdl.soap_actions

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

极致的悲 2024-11-23 09:52:15

Savon 2.x 支持 ssl 全局选项:

Savon.client(ssl_verify_mode: :none)

Savon.client(ssl_version: :SSLv3) 

Savon 2.x support ssl global option:

Savon.client(ssl_verify_mode: :none)

and

Savon.client(ssl_version: :SSLv3) 
一世旳自豪 2024-11-23 09:52:15

不确定您是否已经这样做了,但是当我必须在项目中使用 Savon 时,我发现它非常有用,可以确保 Soap 服务器按照我认为与 SoapUI 一起工作的方式工作(http://www.eviware.com/) 。然后您可以输出两者的 SOAP 请求并进行比较。

Not sure if you did this already, but when I had to use Savon for a project I found it incredibly useful to make sure the Soap server was working as I thought it should with SoapUI (http://www.eviware.com/). You can then output the SOAP request from the two and compare..

最好是你 2024-11-23 09:52:15

Ruby 的 net/http 处理 SSL 握手时存在一个 bug

尝试强制使用 SSL 版本来绕过该错误:

client.http.auth.ssl.sock.ssl_version="SSLv3"

There is a bug in Ruby's net/http handling of the SSL handshake.

Try forcing the SSL version to get around the bug:

client.http.auth.ssl.sock.ssl_version="SSLv3"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文