fix(auth): avoid creating mTLS SSL context for custom async transports#17825
Conversation
There was a problem hiding this comment.
Code Review
This pull request defers the creation of the SSL context during mTLS configuration until after verifying that the request handler is an instance of AiohttpRequest. This prevents unnecessary SSL context creation when a custom transport is used. Additionally, a new test case has been added to verify behavior with custom transports and invalid certificates, and existing tests have been updated to reflect that the SSL context creation helper is no longer called in these scenarios. There are no review comments, so no further feedback is provided.
39cb4c8 to
923b25e
Compare
There was a problem hiding this comment.
I believe there is a small formatting change needed here to "fix" the failing lint CI.
There was a problem hiding this comment.
Thanks - small nit on workflow - in the future try to avoid force pushing, especially after reviews have started, as it can makes following the changes a bit more challenging (though in this case, no harm was really done given the scope of the PR).
If a custom async transport is used (rather than the default AiohttpRequest), the library warns that it cannot configure mTLS. In this case, we should also skip creating the client cert SSL context, preventing unexpected errors or warnings during SSL context generation when a custom transport is in use. Fixes: b/530712364
923b25e to
ba40de0
Compare
If a custom async transport is used (rather than the default AiohttpRequest), the library warns that it cannot configure mTLS. In this case, we should also skip creating the client cert SSL context, preventing unexpected errors or warnings during SSL context generation when a custom transport is in use.
Fixes: b/530712364
Fixes #17622