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

Re: Listening in SSL for daemon mode?

Expand Messages
  • c32fa35e697ccfd9f299f2293b97acb
    ... Hi all, The method below will work, but it s a hack. Anyone who knows a better way, please tell me. Thanks. Rgds, -PY Details ======== 1. Modified
    Message 1 of 2 , Aug 28, 2003
    • 0 Attachment
      --- In soaplite@yahoogroups.com, "c32fa35e697ccfd9f299f2293b97acb"
      <8c32fa35e697ccfd9f299f2293b97acb@h...> wrote:
      >
      > Hi,
      >
      > Is there a stub code for SOAP::Transport::HTTP::Daemon
      > to listen in SSL mode?
      >
      >
      > Thanks.
      >
      >
      > -PY

      Hi all,

      The method below will work, but it's a hack.

      Anyone who knows a better way, please tell me.

      Thanks.

      Rgds,
      -PY

      Details
      ========

      1. Modified HTTP::Daemon so that it is useing IO::Socket::SSL instead of
      IO::Socket::INET

      Here's the diff:
      diff Daemon.pm Daemon.pm.orig
      70c70
      < @ISA=qw(IO::Socket::SSL);
      ---
      > @ISA=qw(IO::Socket::INET);
      170c170
      < @ISA=qw(IO::Socket::SSL);
      ---
      > @ISA=qw(IO::Socket::INET);

      2. Sample soap-client

      #!/usr/bin/perl

      use SOAP::Lite;
      print SOAP::Lite
      -> uri('https://foo.com/Demo/hibye')
      -> proxy('https://localhost:6080/')
      -> hi()
      -> result;

      3. Sample stand alone soap server

      #!/usr/bin/perl -w

      use IO::Socket::SSL;

      use SOAP::Transport::HTTP;


      SOAP::Transport::HTTP::Daemon
      -> new (LocalAddr => 'localhost',
      LocalPort => 6080,
      Proto => 'tcp',
      Reuse => 1,
      SSL_server=> 1,
      SSL_verify_mode => 0x01,
      SSL_key_file => 'your.key',
      SSL_cert_file => 'your.crt',
      SSL_ca_file => 'ca.crt',
      )
      -> dispatch_to('Demo::hibye')
      -> handle;

      package Demo::hibye;

      sub hi {
      return "hello, world";
      }

      sub bye {
      return "goodbye, cruel world";
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.