Soap4r via https (ssl)

hi!

does soap4r also work via https? is it tested and works well?

thanks a lot!
ciao!
florian

Hello Florian,

SOAP4R should work over HTTPS via ssl capable http
server running the script as a cgi. Are you asking if
the SOAP::StandAlone server can handle https requests?

That would have to be WEBrick acting as a ssl server.

--David Ross

···

--- Florian Weber <csshsh@structbench.com> wrote:

hi!

does soap4r also work via https? is it tested and
works well?

thanks a lot!
ciao!
florian

__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

Hi,

does soap4r also work via https? is it tested and works well?

Yes and yes, I hope.

SSL feature of soap4r has been already imported into ruby's CVS. With
coming ruby/1.8.2, you can use SSL feature at both client side and
server side.
cf. http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/sample/soap/ssl/

Here's a client in above sample. SSL client needs http-access2
library. (see RAA)

require 'http-access2'
require 'soap/rpc/driver'
url = "https://localhost:17443/&quot;
client = SOAP::RPC::Driver.new(url, 'urn:sslhelloworld')
client.add_method("hello_world", "from")
client.loadproperty('files/sslclient.properties')
p client.hello_world(__FILE__)

=begin files/sslclient.properties
# verify server's certificate
protocol.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_PEER
# certificates for verification
protocol.http.ssl_config.ca_file = files/ca.cert
protocol.http.ssl_config.ca_file = files/subca.cert
=end

Here's an SSL SOAP server with WEBrick

require 'soap/rpc/httpserver'
require 'webrick/https'
require 'logger'

class HelloWorldServer < SOAP::RPC::HTTPServer
private

  def on_init
    @default_namespace = 'urn:sslhelloworld'
    add_method(self, 'hello_world', 'from')
  end

  def hello_world(from)
    "Hello World, from #{ from }"
  end
end

if $0 == __FILE__
  DIR = File.dirname(File.expand_path(__FILE__))

  def cert(filename)
    OpenSSL::X509::Certificate.new(File.open(File.join(DIR, filename)) { |f|
      f.read
    })
  end

  def key(filename)
    OpenSSL::PKey::RSA.new(File.open(File.join(DIR, filename)) { |f|
      f.read
    })
  end

  $server = HelloWorldServer.new(
    :BindAddress => "0.0.0.0",
    :Port => 17443,
    :AccessLog => ,
    :SSLEnable => true,
    :SSLCACertificateFile => File.join(DIR, 'files/ca.cert'),
    :SSLCertificate => cert('files/server.cert'),
    :SSLPrivateKey => key('files/server.key'),
    :SSLVerifyClient => nil,
    :SSLCertName => nil
  )
  trap(:INT) do
    $server.shutdown
  end
  $server.start
end

Regards,
// NaHi

···

On Tue, 3 Aug 2004 22:43:07 +0900, Florian Weber <csshsh@structbench.com> wrote: