Fixed the problem when shutting down the server via SSL.