diff --git a/examples/client.c b/examples/client.c index 40bfd238..6cc3fddf 100644 --- a/examples/client.c +++ b/examples/client.c @@ -380,6 +380,10 @@ static void init_ssl_ctx(SSL_CTX *ssl_ctx) { #ifndef OPENSSL_NO_NEXTPROTONEG SSL_CTX_set_next_proto_select_cb(ssl_ctx, select_next_proto_cb, NULL); #endif /* !OPENSSL_NO_NEXTPROTONEG */ + +#if OPENSSL_VERSION_NUMBER >= 0x10002000L + SSL_CTX_set_alpn_protos(ssl_ctx, (const unsigned char *)"\x02h2", 3); +#endif /* OPENSSL_VERSION_NUMBER >= 0x10002000L */ } static void ssl_handshake(SSL *ssl, int fd) {