This is an automated email from the ASF dual-hosted git repository.

maskit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 024a76b  Use ERR_get_error_all if available (#7354)
024a76b is described below

commit 024a76bc2b1c4ae1230c2aa6b0ff3aba5d84e607
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Fri Dec 4 09:33:04 2020 +0900

    Use ERR_get_error_all if available (#7354)
    
    ERR_get_error_line_data is going to be deprecated since OpenSSL 3.0.0
---
 configure.ac           | 1 +
 iocore/net/SSLDiags.cc | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/configure.ac b/configure.ac
index ea97c89..d7ab893 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1307,6 +1307,7 @@ AC_CHECK_FUNCS([ \
   CRYPTO_set_mem_functions \
   HMAC_CTX_new \
   X509_get0_signature \
+  ERR_get_error_all \
 ])
 
 AC_CHECK_FUNC([ASN1_STRING_get0_data], [],
diff --git a/iocore/net/SSLDiags.cc b/iocore/net/SSLDiags.cc
index 9d76fd9..1742e7b 100644
--- a/iocore/net/SSLDiags.cc
+++ b/iocore/net/SSLDiags.cc
@@ -137,7 +137,12 @@ SSLDiagnostic(const SourceLocation &loc, bool debug, 
SSLNetVConnection *vc, cons
   }
 
   es = reinterpret_cast<unsigned long>(pthread_self());
+#ifdef HAVE_ERR_GET_ERROR_ALL
+  while ((l = ERR_get_error_all(&file, &line, nullptr, &data, &flags)) != 0) {
+#else
+  // ERR_get_error_line_data is going to be deprecated since OpenSSL 3.0.0
   while ((l = ERR_get_error_line_data(&file, &line, &data, &flags)) != 0) {
+#endif
     if (debug) {
       if (unlikely(diags->on())) {
         diags->log("ssl-diag", DL_Debug, &loc, "SSL::%lu:%s:%s:%d%s%s%s%s", 
es, ERR_error_string(l, buf), file, line,

Reply via email to