From 89b68730a8a23e3393f0fe9623ac6ec4480021a1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 5 Dec 2022 17:29:31 +0100 Subject: Adding upstream version 1.37.1. Signed-off-by: Daniel Baumann --- streaming/sender.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'streaming/sender.c') diff --git a/streaming/sender.c b/streaming/sender.c index 8e637d2bd..62097e39f 100644 --- a/streaming/sender.c +++ b/streaming/sender.c @@ -1114,9 +1114,14 @@ void *rrdpush_sender_thread(void *ptr) { } #ifdef ENABLE_HTTPS - if (netdata_use_ssl_on_stream & NETDATA_SSL_FORCE ){ - security_start_ssl(NETDATA_SSL_CONTEXT_STREAMING); - ssl_security_location_for_context(netdata_ssl_client_ctx, netdata_ssl_ca_file, netdata_ssl_ca_path); + if (netdata_use_ssl_on_stream & NETDATA_SSL_FORCE ) { + static SPINLOCK sp = NETDATA_SPINLOCK_INITIALIZER; + netdata_spinlock_lock(&sp); + if(!netdata_ssl_client_ctx) { + security_start_ssl(NETDATA_SSL_CONTEXT_STREAMING); + ssl_security_location_for_context(netdata_ssl_client_ctx, netdata_ssl_ca_file, netdata_ssl_ca_path); + } + netdata_spinlock_unlock(&sp); } #endif -- cgit v1.2.3