if (RDEBUG_ENABLED3) {
char subject[2048];
- STACK_OF(X509) *our_chain = X509_STORE_CTX_get_chain(x509_ctx);
+ STACK_OF(X509) *our_chain;
int i;
+#if OPENSSL_VERSION_NUMBER >= 0x10101000L
+ our_chain = X509_STORE_CTX_get0_chain(x509_ctx);
+#else
+ our_chain = X509_STORE_CTX_get_chain(x509_ctx);
+#endif
+
RDEBUG3("Certificate chain - %i cert(s) untrusted", untrusted);
for (i = sk_X509_num(our_chain); i > 0 ; i--) {
X509 *this_cert = sk_X509_value(our_chain, i - 1);
/*
* If there's no client certificate, we just return OK.
*/
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ cert = SSL_get0_peer_certificate(ssl); /* Does not increase ref count */
+#else
cert = SSL_get_peer_certificate(ssl); /* Increases ref count */
+#endif
if (!cert) return 1;
store_ctx = X509_STORE_CTX_new();
}
}
+#if OPENSSL_VERSION_NUMBER < 0x30000000L
X509_free(cert);
+#endif
X509_STORE_CTX_free(store_ctx);
return ret;