Skip to content

Proxy connection issue? #1006

@mansfieldj3

Description

@mansfieldj3

When running the below code based on this example, minus the proxy placeholder obvs, I am getting an issue with the network being unreachable, is anyone else encountering this or is this likely to be specific to my environment? Note, when this proxy is set for HTTPS_PROXY and HTTP_PROXY at an environment level I am not encountering this problem

        ctx = ClientContext(url).with_client_certificate(**cert_credentials)
        def set_proxy(request):
            print("Inject proxy settings...")
            proxy = {
                "http": placeholder_proxy,
                "https": placeholder_proxy
            }
            request.proxies = proxy

        ctx.pending_request().beforeExecute += set_proxy

        result = Web.get_context_web_information(ctx).execute_query()
        print(result.value.LibraryVersion)

Error: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f11680899a0>: Failed to establish a new connection: [Errno 101] Network is unreachable')) while establishing connection and retrieving the auth cookie

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions