2010-12-14 25 views
3

我正在使用level3 SOAP API。直到最近當OpenSSL更新時,一切都很好。sslv3使用soap4r時發出意外消息

以下是錯誤消息的完整輸出:

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" 

的結果是相同的,錯誤信息仍然存在。我已經嘗試在肥皂/屬性文件中添加一行,但它不被httpconfigloader識別爲有效的選項。

任何幫助將不勝感激,我完全卡住了。我覺得答案很明顯,但看不到它。

回答

0

我們放棄了soap4r,它嚴重過時了。切換庫雖然不理想,但解決了這個問題。對於遇到類似問題的任何人,我建議切換到savon。它實際上是更容易比我想象的要

0

您需要設置的配置上的HTTP實例:

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

+0

我已經發現了很多東西,那就是soap4r。我本來希望能夠訪問http對象,而不會將soap4r攻擊到底層的http實例。我可以使用我在票證文本中提到的方法設置其他ssl配置選項。 – 2010-12-20 06:21:23

0

似乎與最新的寶石,這是選項如何設置:

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

其中「JIRA」是JiraTool類的一個實例。

+0

哪個寶石? Soap4r在過去3年似乎沒有變化。這似乎是我嘗試過的:'object = WsdlToRubyPortType.new object.options ['client.protocol.http.ssl_config.options'] = OpenSSL :: SSL :: OP_NO_TICKET' – 2011-06-13 22:53:32

0

只是一個猜測:您可能需要先指定OP_ALL然後或OP_NO_TICKET位:

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 

沒有測試過這一點。