Close socket on ssl shutdown