updated for SSL