Added handling of SSL Certificate errors