refactored keep-alive-ssl server script