Skip to content

Commit

Permalink
more TLS settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Nov 28, 2023
1 parent 63dcc2e commit 4eb0027
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

2.0.0rc3 (2023-11-28)
--------------------

- Feature: set env ``INDEX_SSL_SHOW_WARN=1`` to pass as ``ssl_show_warn`` kwarg in OpenSearch client [jensens]
- Feature: set env ``INDEX_SSL_ASSERT_HOSTNAME=1`` to pass as ``ssl_assert_hostname`` kwarg in OpenSearch client [jensens]


2.0.0rc2 (2023-11-28)
--------------------

Expand Down
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ INDEX_VERIFY_CERTS

Default: 0

INDEX_SSL_SHOW_WARN
Whether to warn for unverified TLS request is made or not.

Default: 0

INDEX_SSL_ASSERT_HOSTNAME
Whether to assert the hostname in TLS request or not.

Default: 0

INDEX_LOGIN
Username for the ElasticSearch 8+ or OpenSearch server.

Expand All @@ -76,6 +86,7 @@ INDEX_PASSWORD

Default: admin


CELERY_BROKER
The broker URL for Celery.
See `docs.celeryq.dev <https://docs.celeryq.dev/>`_ for details.
Expand Down
6 changes: 6 additions & 0 deletions src/collective/elastic/ingest/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ def get_client(index_server_baseurl: str = ""):
kwargs["verify_certs"] = bool(
int(os.environ.get("INDEX_VERIFY_CERTS", "0"))
)
kwargs["ssl_show_warn"] = bool(
int(os.environ.get("INDEX_SSL_SHOW_WARN", "0"))
)
kwargs["ssl_assert_hostname"] = bool(
int(os.environ.get("INDEX_SSL_ASSERT_HOSTNAME", "0"))
)
kwargs["http_auth"] = auth
logger.info(f"OpenSearch client kwargs: {kwargs}")
client = OpenSearch(**kwargs)
Expand Down

0 comments on commit 4eb0027

Please sign in to comment.