使用soap4r时sslv3警报意外消息
我正在针对 level3 SOAP API 进行工作。一切都运行得很好,直到最近 OpenSSL 更新为止。
以下是错误消息的完整输出:
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert unexpected message):
httpclient (2.1.5.2) lib/httpclient/session.rb:247:in `connect'
httpclient (2.1.5.2) lib/httpclient/session.rb:247:in `ssl_connect'
httpclient (2.1.5.2) lib/httpclient/session.rb:639:in `connect'
httpclient (2.1.5.2) lib/httpclient/timeout.rb:128:in `timeout'
httpclient (2.1.5.2) lib/httpclient/session.rb:631:in `connect'
httpclient (2.1.5.2) lib/httpclient/session.rb:522:in `query'
httpclient (2.1.5.2) lib/httpclient/session.rb:147:in `query'
httpclient (2.1.5.2) lib/httpclient.rb:953:in `do_get_block'
httpclient (2.1.5.2) lib/httpclient.rb:765:in `do_request'
httpclient (2.1.5.2) lib/httpclient.rb:848:in `protect_keep_alive_disconnected'
httpclient (2.1.5.2) lib/httpclient.rb:764:in `do_request'
httpclient (2.1.5.2) lib/httpclient.rb:666:in `request'
httpclient (2.1.5.2) lib/httpclient.rb:596:in `post'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:238:in `send_post'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:172:in `send'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:179:in `route'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:143:in `call'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:181:in `call'
(eval):6:in `validateSLServiceAvailability'
该错误与此处报告的错误非常相似:
http://dev.ctor.org/http-access2/ticket/223
打开上述内容的人的解决方案是“我通过将 SSL::OP_NO_TICKET 作为 SSLConfig 的选项传递来修复此问题”。我尝试通过以下方式执行此操作:
object = WsdlToRubyPortType.new
object.options['client.protocol.http.ssl_config.options'] = OpenSSL::SSL::OP_NO_TICKET
我也尝试了以下操作:
object.options['client.protocol.http.ssl_config.options'] = "OpenSSL::SSL::OP_NO_TICKET"
object.options['client.protocol.http.ssl_config.options'] = "SSL::OP_NO_TICKET"
结果相同,并且错误消息仍然存在。我尝试在soap/property 文件中添加一行,但httpconfigloader 未将其识别为有效选项。
任何帮助将不胜感激,我完全陷入困境。我觉得答案很明显,但看不到。
I am working against the level3 SOAP API. Everything was working wonderfully until recently when OpenSSL was updated.
Here is the full output of the error message:
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert unexpected message):
httpclient (2.1.5.2) lib/httpclient/session.rb:247:in `connect'
httpclient (2.1.5.2) lib/httpclient/session.rb:247:in `ssl_connect'
httpclient (2.1.5.2) lib/httpclient/session.rb:639:in `connect'
httpclient (2.1.5.2) lib/httpclient/timeout.rb:128:in `timeout'
httpclient (2.1.5.2) lib/httpclient/session.rb:631:in `connect'
httpclient (2.1.5.2) lib/httpclient/session.rb:522:in `query'
httpclient (2.1.5.2) lib/httpclient/session.rb:147:in `query'
httpclient (2.1.5.2) lib/httpclient.rb:953:in `do_get_block'
httpclient (2.1.5.2) lib/httpclient.rb:765:in `do_request'
httpclient (2.1.5.2) lib/httpclient.rb:848:in `protect_keep_alive_disconnected'
httpclient (2.1.5.2) lib/httpclient.rb:764:in `do_request'
httpclient (2.1.5.2) lib/httpclient.rb:666:in `request'
httpclient (2.1.5.2) lib/httpclient.rb:596:in `post'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:238:in `send_post'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:172:in `send'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:179:in `route'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:143:in `call'
/Users/glanotte/.rvm/gems/ruby-1.8.7-p302/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:181:in `call'
(eval):6:in `validateSLServiceAvailability'
The error is very similar to the error reported here:
http://dev.ctor.org/http-access2/ticket/223
the solution that the person who opened the above was "I fixed this by passing in SSL::OP_NO_TICKET as an option to SSLConfig." I have tried to do this by:
object = WsdlToRubyPortType.new
object.options['client.protocol.http.ssl_config.options'] = OpenSSL::SSL::OP_NO_TICKET
I have tried the following as well:
object.options['client.protocol.http.ssl_config.options'] = "OpenSSL::SSL::OP_NO_TICKET"
object.options['client.protocol.http.ssl_config.options'] = "SSL::OP_NO_TICKET"
The results are identical and the error message persists. I have tried adding a line to the soap/property file but it is not recognized as a valid option by the httpconfigloader.
Any help would be greatly appreciated, I am completely stuck. I feel the answer is obvious but cannot see it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您需要在 HTTP 实例上设置配置:
You would need to set the config on the HTTP instance:
似乎使用最新的 gem,可以这样设置选项:
其中“jira”是 JiraTool 类的实例。
It seems that with the latest gem, this is how the option can be set:
where "jira" is an instance of a JiraTool class.
我们最终放弃了soap4r,它已经严重过时了。切换库虽然不理想,但解决了问题。对于遇到类似问题的任何人,我建议切换到 savon。实际上比我想象的要容易
We ended up dropping soap4r, it is severely out of date. Switching libraries, while not ideal, solved the problem. For anyone running into issues similar to this, I recommend switching to savon. It was actually easier than I thought it would be
只是猜测:您可能需要首先指定 OP_ALL,然后在 OP_NO_TICKET 位中指定 OR:
尚未对此进行测试。
Just a guess: you may need to first specify OP_ALL then OR in the OP_NO_TICKET bit:
Haven't tested this.