More exception handling for SSL connections