]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Don't attempt a QUIC connection without specifying ALPN
authorMatt Caswell <matt@openssl.org>
Fri, 24 Mar 2023 12:02:37 +0000 (12:02 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 8 May 2023 09:13:39 +0000 (10:13 +0100)
ALPN is required for a successful QUIC connection, so do not allow the
-quic option for s_client without -alpn

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20580)

apps/s_client.c

index f0ea14a284833f029f8571c547d4ce49568aeb05..2301c70449d75791df98dc9dde08e1f061486a1a 100644 (file)
@@ -2166,6 +2166,10 @@ int s_client_main(int argc, char **argv)
         BIO_printf(bio_err, "%s: QUIC does not support the -tfo option\n", prog);
         goto end;
     }
+    if (isquic && alpn_in == NULL) {
+        BIO_printf(bio_err, "%s: QUIC requires ALPN to be specified (e.g. \"h3\" for HTTP/3) via the -alpn option\n", prog);
+        goto end;
+    }
 #endif
 
     if (tfo)