 +
 +	return SSL_TLSEXT_ERR_OK;
 +}
-+
-+#elif defined(HAVE_TLS_NPN)
++#endif
++#if defined(HAVE_TLS_NPN)
 +/*
 + * This callback function is executed when SSL needs to decide what protocols
 + * to advertise during Next Protocol Negotiation (NPN).  It must produce a

 } bio_filter_in_ctx_t;
 
 /*
@@ -1412,6 +1414,42 @@
         APR_BRIGADE_INSERT_TAIL(bb, bucket);
     }
 

+		if (sslconn->alpn_negofns) {
+	#ifdef HAVE_TLS_ALPN
+			SSL_get0_alpn_selected(inctx->ssl, &next_proto, &next_proto_len);
+	#endif
+	#ifdef HAVE_TLS_ALPN
+           if (!next_proto) {
+               SSL_get0_next_proto_negotiated(
+								   inctx->ssl, &next_proto, &next_proto_len);
+           }
+	#endif
+			ap_log_cerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, f->c,
+						  APLOGNO(02306) "SSL negotiated protocol: '%s'",
