Skip to content

fix: create SSL contexts with an explicit client TLS protocol - #288

Open
stukid wants to merge 1 commit into
aws:masterfrom
stukid:fix/explicit-client-tls-context
Open

stukid wants to merge 1 commit into
aws:masterfrom
stukid:fix/explicit-client-tls-context

Conversation

@stukid

@stukid stukid commented Oct 19, 2026

Copy link
Copy Markdown

Description

Create SSL contexts with PROTOCOL_TLS_CLIENT instead of the deprecated no-argument SSLContext() constructor. Preserve the existing mode-specific hostname policy: verify-ca validates the certificate chain, an explicit verify-full enforces the hostname, and the driver-selected verify-full keeps its existing hostname-warning behavior. Certificate validation remains CERT_REQUIRED.

Add three regression cases covering those policies and treating TLS deprecation warnings as errors. Existing hostname-mismatch and untrusted-chain tests are retained.

Motivation and Context

On Python 3.12, every SSL connection with redshift-connector 2.2.0 emits deprecation warnings for the default SSL context and PROTOCOL_TLS. Applications treating deprecation warnings as errors cannot establish a connection.

Testing

  • Python 3.12.10, pytest 7.3.2, pandas 2.3.3: full test/unit suite, 2089 passed.
  • ./build.sh: passed.
  • Live Amazon Redshift single-node rg.large: 28 IAM-authenticated Datus adapter integration tests passed with this driver patch and DeprecationWarning treated as an error. The suite exercises SQL, metadata, the shared typed adapter contract, and TPC-H data.
  • New regression file passes Black 23.7.0 and isort 5.10.1 checks; git diff --check passes.
  • Repository pre-commit hooks were run in a temporary worktree containing this patch. The configured formatters would rewrite existing files, and mypy reports existing errors. Unmodified master reproduces the formatting failures and the same 119 mypy errors in six existing source files; the patch keeps unrelated formatting changes out of this PR.
  • With pandas 3.0.6, the existing test_write_dataframe_handles_pandas_types fails identically on unmodified master; no pandas compatibility changes are included here.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • Local run of ./build.sh succeeds
  • Code changes have been run against the repository's pre-commit hooks (baseline failures noted above)
  • Commit messages follow Conventional Commits
  • I have read the README and contributing guidelines
  • I have added tests to cover my changes
  • I have run all unit tests using pytest test/unit and they are passing in the environment listed above

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