From 99b4ff8b6f6681ef1f5c2a0ccab49b95aa15b75c Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Thu, 30 Jan 2014 11:24:15 +0100
Subject: [PATCH] http2-openssl: verify that NPN functionality is present

---
 configure.ac       | 3 ++-
 lib/vtls/openssl.c | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ab9bf0376b..2bc86083fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1594,7 +1594,8 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
                     ENGINE_cleanup \
                     CRYPTO_cleanup_all_ex_data \
                     SSL_get_shutdown \
-                    SSLv2_client_method )
+                    SSLv2_client_method \
+                    SSL_CTX_set_next_proto_select_cb )
 
     dnl Make an attempt to detect if this is actually yassl's headers and
     dnl OpenSSL emulation layer. We still leave everything else believing
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 7374c133f3..264dcf7c6c 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -1400,6 +1400,12 @@ static void ssl_tls_trace(int direction, int ssl_ver, int content_type,
 #endif
 
 #ifdef USE_NGHTTP2
+
+#if !defined(HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB) || \
+  defined(OPENSSL_NO_NEXTPROTONEG)
+#error http2 builds require OpenSSL with NPN support
+#endif
+
 /*
  * in is a list of lenght prefixed strings. this function has to select
  * the protocol we want to use from the list and write its string into out.
-- 
GitLab