我在Ruby中有一個SOAP客戶端,我試圖與Ruby SOAP服務器合作,但都無濟於事。客戶端使用Python SOAP服務器正常工作於SSL,但與Ruby版本無關。這裏的服務器是什麼樣子:Ruby SOAP SSL Woes
require 'soap/rpc/standaloneServer'
require 'soap/rpc/driver'
require 'rubygems'
require 'httpclient'
def cert(filename)
OpenSSL::X509::Certificate.new(File.open("path to cert.cert") { |f|
f.read
})
end
def key(filename)
OpenSSL::PKey::RSA.new(File.open("path to rsaprivate.key") { |f|
f.read
})
end
class Server < SOAP::RPC::HTTPServer
~code snipped for readability~
end
server = Server.new(:BindAddress => HelperFunctions.local_ip, :Port => 1234, :SSLCertificate => cert("path to cert"), :SSLPrivateKey => key("path to rsa private key"))
new_thread = Thread.new { server.start }
我已經削減了部分代碼爲了便於閱讀的緣故(例如,我在那裏有我揭露了一些方法),它工作正常使用SSL關閉。但是,當客戶端試圖連接,它看到這一點:
warning: peer certificate won't be verified in this SSL session
/usr/lib/ruby/1.8/net/http.rb:567: warning: using default DH parameters.
/usr/lib/ruby/1.8/net/http.rb:586:in `connect': unknown protocol (OpenSSL::SSL::SSLError)
我試圖從this post採取了一些意見,現在我看到這條消息:
/usr/lib/ruby/1.8/soap/httpconfigloader.rb:64:in `set_ssl_config': SSL not supported (NotImplementedError)
就如何解決這將是極大的任何想法讚賞。
我有同樣的問題,但對於客戶端。我試過'要求'webrick/https'`無濟於事。你在客戶端有過成功嗎? – 2009-10-09 20:18:47