Added SSL certificate validation if https API is used