Skip to content

fix(connect): warn when TLS verification is disabled#465

Open
tdstein wants to merge 1 commit intofeat/bootstrap-auth-tls-verify-python-settings-content-buildfrom
fix/warn-on-tls-verify-disabled
Open

fix(connect): warn when TLS verification is disabled#465
tdstein wants to merge 1 commit intofeat/bootstrap-auth-tls-verify-python-settings-content-buildfrom
fix/warn-on-tls-verify-disabled

Conversation

@tdstein
Copy link
Copy Markdown
Collaborator

@tdstein tdstein commented Apr 9, 2026

Summary

Client(verify=False) silently disabled all TLS certificate validation. This change emits a prominent UserWarning at Client construction when verify is False, recommending a CA bundle path instead.

  • Strict verify is False identity check — verify=True and string CA bundle paths are unaffected.
  • Warning fires once at construction, not per request.

Test plan

  • Existing test_verify_false wrapped in pytest.warns
  • New test_verify_false_emits_warning
  • New test_verify_true_no_warning + test_verify_ca_bundle_no_warning (using warnings.simplefilter("error"))
  • 34 tests in tests/posit/connect/test_client.py pass
  • CI

Targets feat/bootstrap-auth-tls-verify-python-settings-content-build — the verify= parameter was introduced there (#463).

Emit a UserWarning at Client construction time when `verify=False` is
passed, to alert users that disabling TLS certificate verification is
insecure and should not be used in production.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
2389 2239 94% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/posit/connect/client.py 99% 🟢
TOTAL 99% 🟢

updated for commit: 14a7442 by action🐍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant