auth: configure_mtls_channel() discards existing session configuration

Open
#18,314 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

priority: p2 type: bug

In AsyncAuthorizedSession.configure_mtls_channel() (packages/google-auth/google/auth/aio/transport/sessions.py), configuring mutual TLS replaces self._auth_request with a newly constructed aiohttp.ClientSession and aiohttp.TCPConnector:

connector = aiohttp.TCPConnector(ssl=ssl_context)
new_session = aiohttp.ClientSession(connector=connector)
old_auth_request = self._auth_request
self._auth_request = AiohttpRequest(session=new_session)

Because new_session is instantiated from scratch with default arguments, we lose any custom configurations provided by callers on the initial session, such as connection pool limits, timeouts, etc.

Dominant language
Python
Stars
5.4k
Forks
1.8k
Avg merge
2d 7h
Merged PRs (30d)
173

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-python

All issues in googleapis/google-cloud-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.