From a4cdc3c5e864c3ee4b836c78f92e07229be39c0f Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 13 Aug 2022 19:51:02 +0200 Subject: [PATCH] test: allow to run init_ssl() multiple times --- test/regress_openssl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/regress_openssl.c b/test/regress_openssl.c index 3ea767c6c9..89cc01407f 100644 --- a/test/regress_openssl.c +++ b/test/regress_openssl.c @@ -150,6 +150,11 @@ get_ssl_ctx(void) void init_ssl(void) { + static int initialized; + if (initialized) + return; + initialized = 1; + #if (OPENSSL_VERSION_NUMBER < 0x10100000L) || \ (defined(LIBRESSL_VERSION_NUMBER) && \ LIBRESSL_VERSION_NUMBER < 0x20700000L)