1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
From 71f2f6df263871bf56372160291f47e81856046c Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 10 Nov 2021 16:36:40 +0100
Subject: [PATCH] drop deprecated call with OpenSSL 3.0
---
src/ssl/ssl_openssl_impl.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/ssl/ssl_openssl_impl.cpp b/src/ssl/ssl_openssl_impl.cpp
index 3b1124378..90f8ba631 100644
--- a/src/ssl/ssl_openssl_impl.cpp
+++ b/src/ssl/ssl_openssl_impl.cpp
@@ -91,7 +91,11 @@ static void ssl_log_errors(const char* context) {
const char* data;
int flags;
int err;
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+ while ((err = ERR_get_error_all(NULL, NULL, NULL, &data, &flags)) != 0) {
+#else
while ((err = ERR_get_error_line_data(NULL, NULL, &data, &flags)) != 0) {
+#endif
char buf[256];
ERR_error_string_n(err, buf, sizeof(buf));
LOG_ERROR("%s: %s:%s", context, buf, (flags & ERR_TXT_STRING) ? data : "");
@@ -104,7 +108,11 @@ static String ssl_error_string() {
int flags;
int err;
String error;
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+ while ((err = ERR_get_error_all(NULL, NULL, NULL, &data, &flags)) != 0) {
+#else
while ((err = ERR_get_error_line_data(NULL, NULL, &data, &flags)) != 0) {
+#endif
char buf[256];
ERR_error_string_n(err, buf, sizeof(buf));
if (!error.empty()) error.push_back(',');
|