Skip to content

feat: add skip tls and custom certificate bundle#1

Open
dabrign wants to merge 1 commit intodavlgd:mainfrom
dabrign:main
Open

feat: add skip tls and custom certificate bundle#1
dabrign wants to merge 1 commit intodavlgd:mainfrom
dabrign:main

Conversation

@dabrign
Copy link
Copy Markdown

@dabrign dabrign commented Mar 14, 2025

Add TLS configuration options to API client

This PR adds support for customising TLS verification settings in the API client through environment variables:

  • SKIP_TLS_VERIFY: When set to "true", "1", or "yes", disables TLS certificate verification
  • CUSTOM_CA_BUNDLE: Path to a custom CA certificate bundle for verification
  • CLIENT_CERT_PATH: Path to client certificate for mutual TLS authentication
  • CLIENT_KEY_PATH: Path to client key when using a separate key file

The implementation includes proper error handling with helpful error messages if certificate files aren't found, and adds appropriate logging throughout the verification process.

Usage

To use these new TLS configuration options, set one or more of the following environment variables before running the application:

# To disable TLS verification (use with caution)
export SKIP_TLS_VERIFY=true

# To use a custom CA bundle
export CUSTOM_CA_BUNDLE=/path/to/ca-bundle.pem

# For client certificate authentication
export CLIENT_CERT_PATH=/path/to/client-cert.pem
export CLIENT_KEY_PATH=/path/to/client-key.pem

If none of these variables are set, the application will follow the default behavior (verify TLS certificates using system CA certificates, no client certificate).

These changes make the API client more flexible for environments with custom security requirements while maintaining secure defaults.

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