From 8e5ab14744bcab0e361e3c9e5ffeb5934a6d83e5 Mon Sep 17 00:00:00 2001 From: Dustin Black Date: Fri, 15 Dec 2023 11:56:14 +0100 Subject: [PATCH] fix http authentication --- arcaflow_plugin_opensearch/opensearch_plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arcaflow_plugin_opensearch/opensearch_plugin.py b/arcaflow_plugin_opensearch/opensearch_plugin.py index f8b07fd..19d2ddd 100644 --- a/arcaflow_plugin_opensearch/opensearch_plugin.py +++ b/arcaflow_plugin_opensearch/opensearch_plugin.py @@ -22,12 +22,15 @@ def store( if params.username: opensearch = OpenSearch( hosts=params.url, - basic_auth=[params.username, params.password], + http_auth=(params.username, params.password), verify_certs=params.tls_verify, ) # Support for servers that don't require authentication else: - opensearch = OpenSearch(hosts=params.url) + opensearch = OpenSearch( + hosts=params.url, + verify_certs=params.tls_verify, + ) resp = opensearch.index(index=params.index, body=params.data) if resp["result"] != "created": raise Exception(f"Document status: {resp['_shards']}")