Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^3: SSL Soap Server daemon stopping

by Anonymous Monk
on Aug 23, 2008 at 07:33 UTC ( #706387=note: print w/replies, xml ) Need Help??

in reply to Re^2: SSL Soap Server daemon stopping
in thread SSL Soap Server daemon stopping

Here's a fix :) If something dies, add some eval {};warn $@ if $@;
#!/usr/bin/perl -w use HTTP::Daemon::SSL; use HTTP::Status; use SOAP::Lite; use SOAP::Transport::HTTP; use XML::Simple; use TTPSubmit; while(1){ # infinite loop, if Daemon stop for some reason # Make sure you have a certs/ directory with "server-cert.pem" # and "server-key.pem" in it before running this! my $daemon = new HTTP::Daemon::SSL SSL_key_file => '(takenout)server-key.pem', SSL_cert_file => '(takenout)server-cert.pem', LocalPort => 8080; my $soap = SOAP::Transport::HTTP::Server -> new ( ) -> dispatch_to('TTPSubmit'); print "Please contact me at: <URL:", $daemon->url, ">\n"; while (my $conn = $daemon->accept()) { while (my $request = $conn->get_request()) { $soap->request($request); $soap->handle(); my $response = $soap->response(); $conn->send_response($response); } $conn->close; undef($conn); } }

Replies are listed 'Best First'.
Re^4: SSL Soap Server daemon stopping
by perlchild (Acolyte) on Aug 24, 2008 at 22:14 UTC

    Tried your loop fix, it is still stopping. I will try to move it to another port instead of 8080.

      Then it must do more than stop, like die or exit. Use eval to trap die.

        Ok, this has been running for 4 years now, then today it started just stopping again when a valid request is sent to the server. Here is my debug output for it this time around and it looks like IO Socket SSL is having a problem finding my cert files. I don't know why it just started this. Is there an update to that perl module that I don't know about and should be using?

        Here is debug output:

        [root@host1 TTPSubmit]# DEBUG: .../IO/Socket/ accept create +d normal socket HTTP::Daemon::ClientConn::SSL=GLOB(0x7f26fe0) DEBUG: .../IO/Socket/ starting sslifying DEBUG: .../IO/Socket/ Net::SSLeay::accept -> -1 DEBUG: .../IO/Socket/ SSL accept attempt failed with unkno +wn errorerror:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared c +ipher DEBUG: .../IO/Socket/ free ctx 132729584 open=132729584 DEBUG: .../IO/Socket/ OK free ctx 132729584 DEBUG: .../IO/Socket/ CA file certs/my-ca.pem not found, us +ing CA path instead. DEBUG: .../IO/Socket/ new ctx 133366496 DEBUG: .../IO/Socket/ IO::Socket::INET configuration faile +derror:00000000:lib(0):func(0):reason(0) DEBUG: .../IO/Socket/ free ctx 133366496 open=133366496 DEBUG: .../IO/Socket/ OK free ctx 133366496 Can't call method "url" on an undefined value at ./ line 4 +2. [root@host1 TTPSubmit]#

        Thanks for your input

Re^4: SSL Soap Server daemon stopping
by perlchild (Acolyte) on Aug 23, 2008 at 12:49 UTC
    Thanks Anonymous Monk and Eyck for all of the help you have provided, it really helped me to look at this problem differently. I should have thought of the infinite loop solution, but that is life. Sometimes you just have to have another brain in the mix! Thanks again! If I could vote yet I would give you two some votes but I'm still just an Initiate. I only have to get two more XP to be a Novice and I can vote then.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://706387]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2018-06-23 18:03 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.