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

2577SSL and SOAP::Lite

Expand Messages
  • dr_aallan
    May 2, 2003
    • 0 Attachment
      I was hoping someone could tell me how to enable SSL support when
      using SOAP::Lite and running the sever in Daemon mode? I'm setting
      HTTPS_CERT_FILE, HTTPS_CERT_KEY, HTTPS_KEY_FILE and HTTPS_CERT_PASS
      (and HTTPS_PROXY_PASSWORD and HTTPS_PROXY_USERNAME) to reasonable
      sounding values and the client just hangs trying to connect to the
      SOAP server.... maybe I'm just being dense, but...

      I'm using Perl 5.8.0 and SOAP::Lite v0.55, and at the server end
      I'm doing something like...

      my $daemon =
      eval("new SOAP::Transport::HTTP::Daemon( LocalPort => 8000 )");

      if ($@) {
      # handle errors here
      }

      # handlers directory
      my $handlers = File::Spec->catdir( $ENV{"LIBRARY_DIR"} );

      # defined handlers for the server
      $daemon->dispatch_to( $handlers, 'shutdown()' );

      # handle it!
      $log->thread($thread_name, "Starting handlers..." );
      $daemon->handle;

      and the client looks like

      my $soap = new SOAP::Lite();

      $soap->uri('https://hostname.domainname/');
      $soap->proxy('https://hostname.domainname:8000');

      # grab result
      my $result;
      eval { $result = $soap->shutdown(); };
      if ( $@ ) {
      print "Error: $@";
      exit;
      }

      # Check for errors
      print "Transport Status: " . $soap->transport()->status() . "\n";

      unless ($result->fault() ) {
      print "SOAP Result : " . $result->result();
      } else {
      print "Fault Code : " . $result->faultcode() ."\n";
      print "Fault String : " . $result->faultstring() ."\n";
      }

      sub SOAP::Transport::HTTP::Client::get_basic_credentials {
      return 'soap_user' => 'password'
      }

      Ideas? Suggestions? Wild guesses...?

      Cheers,
      Al.