From: Christos Tsantilas <christos@chtsanti.net>
Date: Mon, 10 Apr 2023 10:43:56 +0300
Subject: OpenSSL related api fixes

- The OpenSSL functions ERR_load_*_strings() are deprecated since OpenSSL-1.1.0
- FILE structures returned by popen must be released using the pclose
---
 openssl/net_io_ssl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/openssl/net_io_ssl.c b/openssl/net_io_ssl.c
index 9acc6f1..7e58f72 100644
--- a/openssl/net_io_ssl.c
+++ b/openssl/net_io_ssl.c
@@ -187,7 +187,7 @@ static int openssl_cert_passphrase_cb(char *buf, int size, int rwflag, void *u)
 
     FILE *f = popen(script, "r");
     int bytes = fread(buf, 1, size, f);
-    fclose(f);
+    pclose(f);
 
     if (bytes <= 0) {
         ci_debug_printf(1, "Error reading key passphrase from '%s'\n", script);
@@ -376,9 +376,11 @@ void ci_tls_init()
         return;
 
     SSL_library_init();
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
     ERR_load_BIO_strings();
     ERR_load_crypto_strings();
     ERR_load_SSL_strings();
+#endif
     OpenSSL_add_all_algorithms();
 
     if (!init_openssl_mutexes()) {
