diff --git a/miniserv.pl b/miniserv.pl index 8c95226b0..24081f8a1 100755 --- a/miniserv.pl +++ b/miniserv.pl @@ -879,13 +879,6 @@ while(1) { $SIG{'HUP'} = 'IGNORE'; $SIG{'USR1'} = 'IGNORE'; - # Initialize SSL for this connection - if ($use_ssl) { - $ssl_con = &ssl_connection_for_ip( - SOCK, $ipv6fhs{$s}); - $ssl_con || exit; - } - # Close the file handle for the session DBM dbmclose(%sessiondb); @@ -897,6 +890,13 @@ while(1) { &close_all_sockets(); close(LISTEN); + # Initialize SSL for this connection + if ($use_ssl) { + $ssl_con = &ssl_connection_for_ip( + SOCK, $ipv6fhs{$s}); + $ssl_con || exit; + } + print DEBUG "main: Starting handle_request loop pid=$$\n"; while(&handle_request($peera, $locala,