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

How to handle error in SOAP::Transport::HTTP::Daemon

Expand Messages
  • chfoerst@ymail.com
    Hi all, I have a nice running Soap-Server, which can be started in HTTP or HTTPS mode. When I start this in HTTPS mode, and I telnet on the listening Port, the
    Message 1 of 1 , Nov 3, 2010
    View Source
    • 0 Attachment
      Hi all,

      I have a nice running Soap-Server, which can be started in HTTP or HTTPS mode.

      When I start this in HTTPS mode, and I telnet on the listening Port, the Server crashes, because of

      "SSL connect accept failed because of handshake problemserror:00000000:lib(0):func(0):reason(0) ..."

      How can i trap this, so that the server stays alive ?

      Here's my code snippet:

      if ($ssl)
      {
      $daemon = SOAP::Transport::HTTP::Daemon
      -> new (LocalPort => $port, Reuse => 1,
      SSL_use_cert => 1,
      SSL_key_file => 'path/to/server.key',
      SSL_cert_file => 'path/to/server.crt')
      -> on_action(sub {})
      -> dispatch_to('allmy','methodes')
      ;
      }

      $daemon->handle;


      When I try this:

      eval{
      $daemon->handle or warn($!);
      };

      I got the errorcode, but nevertheless the server dies.

      When I use HTTP (leave all the SSL tags in the above deamon out) , the Server sends a normal

      HTTP/1.1 400 Bad Request
      Date: Wed, 03 Nov 2010 10:59:54 GMT
      Server: libwww-perl-daemon/5.818
      Content-Type: text/html
      Content-Length: 57

      <title>400 Bad Request</title>
      <h1>400 Bad Request</h1>


      Thanks in advance for any hint.

      Regards Christian
    Your message has been successfully submitted and would be delivered to recipients shortly.