Skip to content

feat(elastic): configurable TLS options for Elasticsearch/OpenSearch - #11124

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/elastic-tls-options
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/elastic-tls-options

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

Fixes #9974

Problem and change

The Elasticsearch client was created with only the node URL, so TLS connections to clusters whose certificate is signed by a CA outside the system trust store (self-signed or cluster-internal CAs) failed, with no way to configure trust.

Add getElasticTlsOptions(), which builds the client ssl options from the environment:

  • ELASTIC_TLS_CA_FILE: PEM CA certificate (bundle) used to verify the server certificate.
  • ELASTIC_TLS_VERIFY=false: explicit opt-in to skip certificate verification; logs a warning.

createElasticAdapter passes the options only when one of the variables is set, so the default behaviour is unchanged. The variables are documented in the fulltext service README.

Tests

New unit tests foundations/server/packages/elastic/src/__tests__/tls.test.ts. The default (no variables set) is unchanged.

The Elasticsearch client was created with only the node URL, so TLS connections to clusters whose certificate is signed by a CA outside the system trust store (self-signed or cluster-internal CAs) failed, with no way to configure trust.

Add getElasticTlsOptions(), which builds the client ssl options from the environment:
- ELASTIC_TLS_CA_FILE: PEM CA certificate (bundle) used to verify the server certificate.
- ELASTIC_TLS_VERIFY=false: explicit opt-in to skip certificate verification; logs a warning.

createElasticAdapter passes the options only when one of the variables is set, so the default behaviour is unchanged. The variables are documented in the fulltext service README.

Fixes hcengineering#9974

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
@MichaelUray
MichaelUray force-pushed the feat/elastic-tls-options branch from 79a5759 to 1b635b8 Compare October 26, 2026 13:28

This branch has not been deployed

No deployments
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.

Feature Request: Add verify=false option for TLS connections to Elasticsearch/OpenSearch

1 participant