Handling https from a proxy in generate_base_url()