在鞋子應用程序中,我試圖從一些內部網站下載東西。我得到這個錯誤使用鞋子並通過https下載給出了ssl錯誤
Error in /tmp/selfgz14214/ruby/lib/net/protocol.rb line 66
undefined method 'closed?' for #<OpenSSL::SSL::SSLSocket:0xb6af94f0>
我得到了上述錯誤代碼。如果使用Shoes,則會出現上述錯誤。
require 'net/http'
require 'net/https'
require 'rexml/document'
class Blogs
attr_reader :Connection
def initialize
@Connection = Net::HTTP::new("someInternalWebSite", 443)
@Connection.use_ssl = true
end
def get_blogs
doc = REXML::Document.new @Connection.get('/weblogs/feed/entries/atom').body
blogs = Array.new
# ----- some crap to parse the blogs
return blogs
end
end
注意這個問題只發生在從鞋子內部運行時。
同樣使用內置的下載方法,它不會返回,甚至不會引發事件。以下是我還沒有工作(或實際上聽到的)鞋子對於
download "https://internalWebsite/weblogs/feed/entries/atom",
:start => lambda {
alert "hello"
},
:progress => lambda {
alert "progress"
},
:finish => lambda {
alert "finish"
}
對於證書,我收到一條警告,說服務器發送的證書不好,但就是這樣。請注意,從命令行或使用rspec運行時,上面的代碼工作正常(除了證書警告錯誤外)。 但是,如果我只從鞋內跑步,那麼我會遇到這個問題。 – Ram 2008-12-31 12:29:54