Ruby 使用soap4r时出现sslv3警报意外消息

Ruby 使用soap4r时出现sslv3警报意外消息,ruby,openssl,httpclient,soap4r,Ruby,Openssl,Httpclient,Soap4r,我正在使用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'

我正在使用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'
该错误与此处报告的错误非常相似:

打开上述文件的人的解决方案是“我通过将SSL::OP_NO_TICKET作为SSLConfig的一个选项传递给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/属性文件添加一行,但httpconfigloader未将其识别为有效选项


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

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

http=HTTPClient.new
http.ssl\u config.options=OpenSSL::ssl::OP\u NO\u票证


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

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

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

我们最终放弃了soap4r,它已经严重过时了。交换库虽然不理想,但解决了这个问题。对于遇到类似问题的人,我建议切换到。事实上,这比我想象的要容易得多,这只是一个猜测:您可能需要首先指定OP_ALL然后或在OP_NO_票证位中:

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

我还没有测试过这一点。

我已经了解了很多,关键在于soap4r。我曾希望在不将soap4r攻击到底层http实例的情况下访问http对象。我可以使用票证文本中提到的方法设置其他ssl配置选项。哪个gem?Soap4r在过去3年中似乎没有变化。这似乎和我尝试的是一样的:
object=WsdlToRubyPortType.new object.options['client.protocol.http.ssl\u config.options']=OpenSSL::ssl::OP\u NO\u TICKET