XML-RPC over HTTP with SSL

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'd like to run an XML-RPC HTTP server using SSL, without involving a
separate web server.

SOAP-Lite's XMLRPC::Transport::HTTP supports integration with
HTTP::Daemon to create a free-standing HTTP server (just requiring the
addition of forking or similar).  But since
XMLRPC::Transport::HTTP::Daemon calls HTTP::Daemon->new directly, there
doesn't appear to be a way to get it to use HTTP::Daemon::SSL.

One relatively easy solution is to modify the existing SOAP-Lite
modules to do what I need.  This could be done relatively cleanly: I
could create modified versions of XMLRPC::Transport::HTTP and
SOAP::Transport::HTTP (from which most of XMLRPC::Transport::HTTP is
inherited) and create the packages XMLRPC::Transport::HTTP::Daemon::SSL
and SOAP::Transport::HTTP::Daemon::SSL.
XMLRPC::Transport::HTTP::Daemon::SSL would inherit from
SOAP::Transport::HTTP::Daemon::SSL (instead of from
SOAP::Transport::HTTP::Daemon) and SOAP::Transport::HTTP::Daemon::SSL
would call HTTP::Daemon::SSL->new instead of HTTP::Daemon (and the
associated require would change as well).

If this is the best way that's fine, but if there's a good way to do
this using existing packages I'd rather do that.  Is there?
Thanks in advance,

Daniel Lieberman
http://www.bitpusher.com /

Re: XML-RPC over HTTP with SSL

I ended up going with an approach that's slightly more complex, but
slightly less hackish.  I've created packages (with new names) that
started as cut-and-paste copies of XMLRPC::Transport::HTTP::Daemon and
SOAP::Transport::HTTP::Daemon (where my package based on
SOAP::Transport::HTTP::Daemon still inherits from
SOAP::Transport::HTTP::Server) which add support for an argument hash.
Currently, the only parameter supported is "SSL" (boolean).  I've
implemented the appropriate branches to select between HTTP::Daemon and
HTTP::Daemon::SSL based on the value of the SSL parameter (in two
places: the "require" and the call to ->new).

I think that if this got folded back into SOAP-Lite it would be a clean
way to do it, but stylistically it would be out of place (stylistically
adding the ...::Daemon::SSL would be a better match, though the number
of packages is starting to get a bit large).

Daniel Lieberman

Site Timeline