Posted on 2005-05-11 07:21:03-07 by martinw in response to 433
Re: accept() blocks until ssl session is started
Hi *, Peter Behroozi gave me the tip to solve the problem (Thanks, Peter!).
The inital Socket must be opened as an INET socket like:
my $socket = IO::Socket::INET->new( LocalPort => $port, Listen => 10, Reuse => 1 ) or die "Cannot open socket: $!";
The SSL session than starts after the fork command:
while (my $c = $socket->accept) { print "ACCEPT\n"; my $pid = fork(); defined $pid || die "Cannot fork: $!"; next if $pid; IO::Socket::SSL->start_SSL($c, SSL_key_file => '/home/martin/test.key', SSL_cert_file => '/home/martin/test.crt', SSL_use_cert => 1, SSL_server => 1, SSL_cipher_list => 'ALL', ); ...
Now, the daemon will not block after a connect from client without doing the SSL handshake. Regards,
martin!
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.