Skip to content

feat: Support for passing certificate path in httpx calls#409

Open
erichare wants to merge 3 commits into
mainfrom
feat-verify-certs
Open

feat: Support for passing certificate path in httpx calls#409
erichare wants to merge 3 commits into
mainfrom
feat-verify-certs

Conversation

@erichare
Copy link
Copy Markdown
Collaborator

@erichare erichare commented Jun 3, 2026

Supersedes #404 — rebased onto the latest main and recreated from a branch in datastax/astrapy (previously opened from my fork).

This pull request adds support for specifying a custom CA certificate path for SSL verification when connecting to the API. This is useful for environments with custom certificate requirements, such as PrivateLink setups. The change propagates the new ca_cert_path option throughout the codebase, ensures it is properly inherited and handled in configuration objects, and adds unit tests to verify correct behavior.

New SSL certificate configuration support:

  • Added ca_cert_path option to APIOptions and FullAPIOptions, including initialization, representation, inheritance, and default value handling. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Updated APICommander to accept and use a custom SSL context based on ca_cert_path, ensuring the correct SSL context is used for both sync and async clients, and that it is preserved during object copying. [1] [2]

Propagation of CA certificate option in API commander creation:

  • Passed ca_cert_path from APIOptions to all relevant APICommander instantiations in astrapy/admin/admin.py, astrapy/data/collection.py, astrapy/data/database.py, and astrapy/data/table.py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

Testing enhancements:

  • Added unit tests for APICommander to verify correct SSL context creation and inheritance with ca_cert_path, including preservation during copying.
  • Added unit tests for APIOptions to verify correct inheritance and override behavior of ca_cert_path.

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