René's URL Explorer Experiment


Title: Auth(mtls): `_has_logged_mtls_warning` masks distinct mTLS configuration errors · Issue #17697 · googleapis/google-cloud-python · GitHub

Open Graph Title: Auth(mtls): `_has_logged_mtls_warning` masks distinct mTLS configuration errors · Issue #17697 · googleapis/google-cloud-python

X Title: Auth(mtls): `_has_logged_mtls_warning` masks distinct mTLS configuration errors · Issue #17697 · googleapis/google-cloud-python

Description: Determine this is the right repository I determined this is the correct repository in which to report this bug. Summary of the issue Describe the bug In google.auth.transport._mtls_helper.py, the global boolean flag _has_logged_mtls_warn...

Open Graph Description: Determine this is the right repository I determined this is the correct repository in which to report this bug. Summary of the issue Describe the bug In google.auth.transport._mtls_helper.py, the g...

X Description: Determine this is the right repository I determined this is the correct repository in which to report this bug. Summary of the issue Describe the bug In google.auth.transport._mtls_helper.py, the g...

Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/17697

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Auth(mtls): `_has_logged_mtls_warning` masks distinct mTLS configuration errors","articleBody":"### Determine this is the right repository\n\n- [x] I determined this is the correct repository in which to report this bug.\n\n### Summary of the issue\n\n## Describe the bug\nIn `google.auth.transport._mtls_helper.py`, the global boolean flag `_has_logged_mtls_warning` is used to prevent log spam when mTLS auto-enablement fails. However, because it is a single global flag, it suppresses multiple distinct error conditions. \n\nIf a long-running application encounters one configuration error (e.g., file not found), the flag is set to `True`. If the user attempts to fix the configuration but introduces a different error (e.g., the JSON structure is invalid), the new error is silently swallowed for the lifetime of the process.\n\n## To Reproduce\n1. Create a Google API client with `GOOGLE_API_CERTIFICATE_CONFIG` pointing to a non-existent file.\n2. The client will log: `WARNING: mTLS auto-enablement failed: Could not read/parse certificate file...`\n3. Create the file at that path, but omit the required `['cert_configs']['workload']` JSON section.\n4. Create another Google API client in the same Python process.\n5. **Expected behavior:** A new warning should be logged stating the file is missing the required workload section.\n6. **Actual behavior:** No warning is logged. The client silently disables mTLS.\n\n## Root Cause & Context\nThis behavior was introduced in PR #17470 where the implementation used `_LOGGER.warning` combined with a custom global boolean `_has_logged_mtls_warning`. \nBecause the custom flag does not track *which* warning was logged, it permanently disables all future configuration warnings in the process after the first failure. Additionally, it never clears the cache upon a successful read, meaning transient errors will permanently disable warnings for the remainder of the process's lifetime.\n\n\n\n## Proposed Solution\n\nWe should drop the custom global `_has_logged_mtls_warning` state entirely and revert the log level back to `_LOGGER.debug(...)`.\n\n\n\n**Reasoning:**\n\n1. **It restores the intended fallback behavior:** Auto-enablement is designed to be a \"best-effort\" enhancement. If it fails, falling back to standard TLS silently keeps the application running. \n\n2. **Users requiring strict mTLS are protected:** If a user strictly requires mTLS, they should explicitly set `GOOGLE_API_USE_CLIENT_CERTIFICATE=\"true\"`. Doing so bypasses this auto-enablement fallback and hard-fails with a `ClientCertError` if the config is broken.\n\n3. **Debuggability is preserved:** If auto-enablement fails and the standard TLS fallback is subsequently rejected by a server requiring mTLS (e.g., returning a 401/403), the user can turn on debug logging to see exactly why their mTLS configuration was rejected.\n\n4. **Removes custom state:** Reverting to `debug` entirely eliminates the log spam risk, allowing us to safely remove the buggy global cache from this foundational library.","author":{"url":"https://github.com/nbayati","@type":"Person","name":"nbayati"},"datePublished":"2026-07-12T02:54:02Z","url":"https://github.com/googleapis/google-cloud-python/issues/17697"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:89d2088b-3ca3-4883-5bf7-4caf36f75ef5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBE9C:10A6E7:7B7001:A9E6F5:6AFDF0EA
html-safe-nonce17aeef3a933d96ce4afaa8e9c84d653ddf572777518f136a4a869de04951f9bc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTlDOjEwQTZFNzo3QjcwMDE6QTlFNkY1OjZBRkRGMEVBIiwidmlzaXRvcl9pZCI6IjgwMzk4MDA2ODk2NDA5OTMwMDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac64077c5f7433223ffcb421bc07b14cb2970d6e3fecda175b74da57c62694a505
hovercard-subject-tagissue:4865153342
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/17697/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9d900358b9da9b77af5b9814f667b9cd0274e8443a66e0f0bfec147db10238ee/googleapis/google-cloud-python/issues/17697
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9d900358b9da9b77af5b9814f667b9cd0274e8443a66e0f0bfec147db10238ee/googleapis/google-cloud-python/issues/17697
og:image:altDetermine this is the right repository I determined this is the correct repository in which to report this bug. Summary of the issue Describe the bug In google.auth.transport._mtls_helper.py, the g...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenbayati
hostnamegithub.com
expected-hostnamegithub.com
Nonedd812ec581ecac95855f5ec917ef9827506c39a9da1443f43ddb4179a46471eb
turbo-cache-controlno-preview
go-importgithub.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id16316451
octolytics-dimension-repository_nwogoogleapis/google-cloud-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id16316451
octolytics-dimension-repository_network_root_nwogoogleapis/google-cloud-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release32ac708bac264dafdc28e10ff49b4d137f0c34a7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/googleapis/google-cloud-python/issues/17697#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fgoogle-cloud-python%2Fissues%2F17697
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fgoogle-cloud-python%2Fissues%2F17697
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fgoogle-cloud-python
Reloadhttps://github.com/googleapis/google-cloud-python/issues/17697
Reloadhttps://github.com/googleapis/google-cloud-python/issues/17697
Reloadhttps://github.com/googleapis/google-cloud-python/issues/17697
googleapishttps://github.com/googleapis
google-cloud-pythonhttps://github.com/googleapis/google-cloud-python
Codehttps://github.com/googleapis/google-cloud-python
Issues448 (448)https://github.com/googleapis/google-cloud-python/issues
Pull requests199 (199)https://github.com/googleapis/google-cloud-python/pulls
Discussionshttps://github.com/googleapis/google-cloud-python/discussions
Actionshttps://github.com/googleapis/google-cloud-python/actions
Projectshttps://github.com/googleapis/google-cloud-python/projects
Security and qualityhttps://github.com/googleapis/google-cloud-python/security
Insightshttps://github.com/googleapis/google-cloud-python/insights
https://github.com/googleapis/google-cloud-python
New issuehttps://github.com/login?return_to=https://github.com/googleapis/google-cloud-python/issues/17697
New issuehttps://github.com/login?return_to=https://github.com/googleapis/google-cloud-python/issues/17697
#17696https://github.com/googleapis/google-cloud-python/pull/17696
Auth(mtls): _has_logged_mtls_warning masks distinct mTLS configuration errorshttps://github.com/googleapis/google-cloud-python/issues/17697#top
#17696https://github.com/googleapis/google-cloud-python/pull/17696
type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
https://github.com/nbayati
nbayatihttps://github.com/nbayati
on Jul 12, 2026https://github.com/googleapis/google-cloud-python/issues/17697#issue-4865153342
#17470https://github.com/googleapis/google-cloud-python/pull/17470
nbayatihttps://github.com/nbayati
type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
on Jul 12, 2026https://github.com/googleapis/google-cloud-python/issues/17697#event-27865950843
nbayatihttps://github.com/nbayati
completedhttps://github.com/googleapis/google-cloud-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#17696https://github.com/googleapis/google-cloud-python/pull/17696
on Jul 18, 2026https://github.com/googleapis/google-cloud-python/issues/17697#event-28167292090
nbayatihttps://github.com/nbayati
on Jul 18, 2026https://github.com/googleapis/google-cloud-python/issues/17697#event-28167292183
fix(auth): centralize cert discovery logic and steps (#17696)https://github.com/googleapis/google-cloud-python/commit/edc0423e57dd06bef3a93802642a074ab8b7bc5d
#17696https://github.com/googleapis/google-cloud-python/pull/17696
https://docs.github.com/articles/closing-issues-via-commit-messages
edc0423https://github.com/googleapis/google-cloud-python/commit/edc0423e57dd06bef3a93802642a074ab8b7bc5d
hebaalazzehhttps://github.com/hebaalazzeh
on Jul 20, 2026https://github.com/googleapis/google-cloud-python/issues/17697#event-28240215419
fix(auth): centralize cert discovery logic and steps (#17696)https://github.com/googleapis/google-cloud-python/commit/e6f496011f400557aa41e03b8a65fa8346829de1
#17696https://github.com/googleapis/google-cloud-python/pull/17696
https://docs.github.com/articles/closing-issues-via-commit-messages
e6f4960https://github.com/googleapis/google-cloud-python/commit/e6f496011f400557aa41e03b8a65fa8346829de1
Sign up for freehttps://github.com/signup?return_to=https://github.com/googleapis/google-cloud-python/issues/17697
Sign in to commenthttps://github.com/login?return_to=https://github.com/googleapis/google-cloud-python/issues/17697
type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.