3

我正在使用 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 不将其识别为有效选项。

任何帮助将不胜感激,我完全被卡住了。我觉得答案很明显,但看不到。

4

4 回答 4

0

您需要在 HTTP 实例上设置配置:

http = HTTPClient.new
http.ssl_config.options = OpenSSL::SSL::OP_NO_TICKET

于 2010-12-20T05:59:29.540 回答
0

似乎使用最新的 gem,可以这样设置选项:

jira.driver.options["protocol.http.ssl_config.options"] = OpenSSL::SSL::OP_NO_TICKET

其中“jira”是 JiraTool 类的一个实例。

于 2011-06-13T15:39:20.797 回答
0

我们最终放弃了soap4r,它已经严重过时了。切换库虽然不理想,但解决了这个问题。对于遇到类似问题的任何人,我建议切换到savon。实际上比我想象的要容易

于 2012-01-09T14:45:11.573 回答
0

只是一个猜测:您可能需要先指定 OP_ALL,然后在 OP_NO_TICKET 位中指定 OR:

object = WsdlToRubyPortType.new
object.options['client.protocol.http.ssl_config.options'] = OpenSSL::SSL::OP_ALL
object.options['client.protocol.http.ssl_config.options'] |= OpenSSL::SSL::OP_NO_TICKET

没有测试过这个。

于 2016-07-08T16:25:51.267 回答