Loading ...
Sorry, an error occurred while loading the content.

Re: soap/xmlrpc and SSL cerificate

Expand Messages
  • Nils Sowen
    ... Lopezfreemail, ... true? I did a little patch on the SOAP::Transport::HTTP::Daemon so it uses SSL encryption. Just be sure to grab the following modules: -
    Message 1 of 2 , Aug 24, 2004
    View Source
    • 0 Attachment
      --- In soaplite@yahoogroups.com, "lopezfreemail" <lopezfr@f...> wrote:

      Lopezfreemail,

      > I read that standalone daemon does not support SSL server. Thats
      true?

      I did a little patch on the SOAP::Transport::HTTP::Daemon so it uses
      SSL encryption. Just be sure to grab the following modules:

      - IO::Socket::SSL
      - HTTP::Daemon::SSL
      (find it @ http://search.cpan.org/~behroozi/ or search.cpan.org)

      If you place SSL parameters in the constructor for
      SOAP::Transport::HTTP::Daemon it'll use the HTTP::Daemon::SSL class
      instead of the regular one.

      --- PATCH STARTS HERE ---

      392c392,399
      < sub new { require HTTP::Daemon;
      ---
      > sub SSL {
      > my $self = shift->new;
      > @_ ? ($self->{_SSL} = shift, return $self) : return
      $self->{_SSL};
      > }
      >
      > sub http_daemon_class { shift->SSL ? 'HTTP::Daemon::SSL' :
      'HTTP::Daemon' }
      >
      > sub new {
      401c408,415
      < $self->{_daemon} = HTTP::Daemon->new(@params) or Carp::croak
      "Can't create daemon: $!";
      ---
      >
      > # use SSL if there is any parameter with SSL_* in the name
      > $self->SSL(1) if !$self->SSL && grep /^SSL_/, @params;
      > my $http_daemon = $self->http_daemon_class;
      > eval "require $http_daemon" or Carp::croak $@ unless
      UNIVERSAL::can($http_daemon => 'new');
      > $self->{_daemon} = $http_daemon->new(@params) or Carp::croak
      "Can't create daemon: $!";

      --- PATCH STOPS HERE ---

      Now you can run your server with:

      my $daemon = SOAP::Transport::HTTP::Daemon->new(
      LocalPort => 81,
      Listen => 1,
      SSL_use_cert => 1,
      SSL_key_file => 'soap_server.key',
      SSL_cert_file => 'soap_server.cert');

      The client just uses https:// as regular.

      Have fun,
      Nils
    Your message has been successfully submitted and would be delivered to recipients shortly.