Wrap HTTPS setup code in try-catch