我正在使用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不会将其识别为有效选项。
任何帮助都会非常感激,我完全陷入困境。我觉得答案很明显,但看不到它。
答案 0 :(得分:0)
您需要在HTTP实例上设置配置:
http = HTTPClient.new
http.ssl_config.options = OpenSSL :: SSL :: OP_NO_TICKET
答案 1 :(得分:0)
似乎使用最新的gem,这就是如何设置选项:
jira.driver.options["protocol.http.ssl_config.options"] = OpenSSL::SSL::OP_NO_TICKET
其中“jira”是JiraTool类的一个实例。
答案 2 :(得分:0)
我们最终放弃了soap4r,它严重过时了。切换库虽然不理想,但解决了这个问题。对于遇到与此类似问题的任何人,我建议切换到savon。它实际上比我认为的更容易
答案 3 :(得分:0)
猜测一下:您可能需要首先在OP_NO_TICKET位中指定OP_ALL然后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
Haven没有测试过这个。