a67fd2ae15993a7cf5129a53ab1fa193c318bf80
galt
  Tue Dec 14 14:05:17 2021 -0800
Fixing compatibility with openssl 1.1 by removing obsolete ctx->current_cert in https.c, refs #28639

diff --git src/lib/https.c src/lib/https.c
index d787207..7a033a5 100644
--- src/lib/https.c
+++ src/lib/https.c
@@ -307,31 +307,31 @@
     if (getenv("SCRIPT_NAME"))  // CGI mode
 	{
 	fprintf(stderr, "verify error:num=%d:%s:depth=%d:%s CGI=%s\n", err,
 	    X509_verify_cert_error_string(err), depth, buf, getenv("SCRIPT_NAME"));
 	}
     if (!sameString(getenv("https_cert_check"), "log"))
 	{
 	char *cn = strstr(buf, "/CN=");
 	if (cn) cn+=4;  // strlen /CN=
 	warn("%s on %s", X509_verify_cert_error_string(err), cn);
 	}
     }
 /* err contains the last verification error.  */
 if (!preverify_ok && (err == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT))
     {
-    X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), buf, 256);
+    X509_NAME_oneline(X509_get_issuer_name(cert), buf, 256);
     fprintf(stderr, "issuer= %s\n", buf);
     }
 if (sameString(getenv("https_cert_check"), "warn") || sameString(getenv("https_cert_check"), "log"))
     return 1;
 else
     return preverify_ok;
 }
 
 
 static struct hash *initDomainWhiteListHash()
 /* Initialize once, has all the old existing domains 
  * for which cert checking is skipped since they are not compatible (yet) with openssl.*/
 {
 static struct hash *domainWhiteList = NULL;
 static pthread_mutex_t initInUseMutex = PTHREAD_MUTEX_INITIALIZER;