Skip to content

Commit

Permalink
configure: when enabling QUIC, check that TLS supports QUIC
Browse files Browse the repository at this point in the history
Most importantly perhaps is when using OpenSSL that the used
build/flavor has the QUIC API: the vanilla OpenSSL does not, only
BoringSSL, libressl, AWS-LC and quictls do.

Ref: curl@5d044ad#r136780413

Closes curl#12683
  • Loading branch information
bagder committed Jan 12, 2024
1 parent 5d044ad commit b3f02e1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
24 changes: 24 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,11 @@ esac

curl_tcp2_msg="no (--with-ngtcp2)"
if test X"$want_tcp2" != Xno; then

if test "$QUIC_ENABLED" != "yes"; then
AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-ngtcp2 a no-no])
fi

dnl backup the pre-ngtcp2 variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
Expand Down Expand Up @@ -3030,6 +3035,11 @@ esac

curl_http3_msg="no (--with-nghttp3)"
if test X"$want_nghttp3" != Xno; then

if test "$NGTCP2_ENABLED" != "1"; then
AC_MSG_ERROR([--with-nghttp3 also requires --with-ntcp2])
fi

dnl backup the pre-nghttp3 variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
Expand Down Expand Up @@ -3120,6 +3130,10 @@ esac

if test X"$want_quiche" != Xno; then

if test "$QUIC_ENABLED" != "yes"; then
AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-quiche a no-no])
fi

if test "$NGHTTP3_ENABLED" = 1; then
AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
fi
Expand Down Expand Up @@ -3218,6 +3232,16 @@ esac

if test X"$want_msh3" != Xno; then

dnl msh3 on non-Windows needs an OpenSSL with the QUIC API
if test "$curl_cv_native_windows" != "yes"; then
if test "$QUIC_ENABLED" != "yes"; then
AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-msh3 a no-no])
fi
if test "$OPENSSL_ENABLED" != "1"; then
AC_MSG_ERROR([msh3 requires OpenSSL])
fi
fi

if test "$NGHTTP3_ENABLED" = 1; then
AC_MSG_ERROR([--with-msh3 and --with-ngtcp2 are mutually exclusive])
fi
Expand Down
1 change: 1 addition & 0 deletions m4/curl-gnutls.m4
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ if test "x$OPT_GNUTLS" != xno; then
GNUTLS_ENABLED=1
USE_GNUTLS="yes"
ssl_msg="GnuTLS"
QUIC_ENABLED=yes
test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
],
[
Expand Down
9 changes: 9 additions & 0 deletions m4/curl-openssl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,15 @@ if test "x$OPT_OPENSSL" != xno; then
])
fi
dnl is this OpenSSL (fork) providing the original QUIC API?
AC_CHECK_FUNCS([SSL_set_quic_use_legacy_codepoint],
[QUIC_ENABLED=yes])
if test "$QUIC_ENABLED" = "yes"; then
AC_MSG_NOTICE([OpenSSL fork speaks QUIC API])
else
AC_MSG_NOTICE([OpenSSL version does not speak QUIC API])
fi
if test "$OPENSSL_ENABLED" = "1"; then
if test -n "$LIB_OPENSSL"; then
dnl when the ssl shared libs were found in a path that the run-time
Expand Down
1 change: 1 addition & 0 deletions m4/curl-wolfssl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ if test "x$OPT_WOLFSSL" != xno; then
WOLFSSL_ENABLED=1
USE_WOLFSSL="yes"
ssl_msg="WolfSSL"
QUIC_ENABLED=yes
test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
],
[
Expand Down

0 comments on commit b3f02e1

Please sign in to comment.