in reply to Re: Soap::lite - https ?
in thread Soap::lite - https ?

Yeah.. that's the part that I didn't understand. Guess it was a bit too easy.

I need to install the bare minimum and have the data encrypted somehow.

Replies are listed 'Best First'.
Re^3: Soap::lite - https ?
by erroneousBollock (Curate) on Aug 10, 2007 at 04:47 UTC
    There is a HTTP::Daemon::SSL module which can be used easily from SOAP::Lite.

    If your server is single-threaded or forking, that should be enough. If your server needs to be multi-threaded, you will run into problems with SSL misbehaving under threads.

    I ended up writing a multiplexed (single-threaded server) directly on top of IO::Socket::SSL, inside a module which gets passed a Thread::Queue handle so that the work for each connection can be farmed out to other threads.

    I got some help here with the mutliplexing HTTPS server, so do a super-search and you'll find a working example.

    -David

      There is a HTTP::Daemon::SSL module which can be used easily from SOAP::Lite.

      Can you give me any more information about this?

      I have a working version running via 'ssltunnel'. My next step is to process the info from a java client. Gah.
        Sorry for the delay, it would appear we're in distant timezones.

        Hmmm, when I initially did this long ago, I had to sub-class SOAP::Transport::HTTP::Daemon but I see that is no longer necessary.

        Starting with the HTTP::Daemon server transport example from the SOAP::Lite guide, just pass the normal SSL options (defined in IO::Socket::SSL docs) to the new() call on SOAP::Transport::HTTP::Daemon.

        If you don't need peer authentication, the following should work:

        ->new( LocalPort => 443, SSL_server => 1 ) ->dispatch_to(...)

        IO::Socket::SSL seems to default the remaining options correctly inside HTTP::Daemon.

        If you do need peer authentication, start reading about the options (and use of OpenSSL in general) in the docs for IO::Socket::SSL and Net::SSLeay.

        If you want any more control over how each request is handled (before being passed to SOAP::Lite), you'll need to sub-class SOAP::Transport::HTTP::Daemon... there are a variety of other benefits to doing so.

        -David.


        Yes it is possible when you define server code like this:
        my $daemon = SOAP::Transport::HTTP::Daemon
        ->new( LocalPort => DAEMON_PORT,
        Listen => 1,
        SSL_use_cert => 1,
        SSL_key_file => PRIVATE_KEY_PATH,
        SSL_cert_file => CERTIFICATE_PATH,
        Reuse => 1)
        -> dispatch_to('Handler');

        Off course, you have to install HTTP::Daemon::SSL, generate a certificate and a private key before using this code...

        It's a few late but it should be usefull for other poeples like me, a week ago...