Skip to content

Commit

Permalink
gnutls: fix connection state check on handshake
Browse files Browse the repository at this point in the history
When running curl event based, connect attempts stalled as the 'done'
check was using the wrong state in gnutls.

Add event based pytest runs to all http3 jobs and the openssl and
mbedtls ones on linux.

Closes curl#16423
  • Loading branch information
icing authored and bagder committed Feb 22, 2025
1 parent ea07a64 commit 952770d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/http3-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ jobs:
--with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug --disable-ntlm
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-openssl=$HOME/quictls/build --enable-ssls-export
--with-libuv
- name: gnutls
PKG_CONFIG_PATH: '$HOME/gnutls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
Expand All @@ -240,6 +241,7 @@ jobs:
--with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-gnutls=$HOME/gnutls/build --enable-ssls-export
--with-libuv
- name: wolfssl
PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
Expand All @@ -249,6 +251,7 @@ jobs:
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-wolfssl=$HOME/wolfssl/build
--enable-ech --enable-ssls-export
--with-libuv
- name: wolfssl
PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
Expand All @@ -257,6 +260,7 @@ jobs:
-DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
-DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
-DUSE_ECH=ON
-DCURL_USE_LIBUV=ON
- name: openssl-quic
PKG_CONFIG_PATH: '$HOME/openssl/build/lib64/pkgconfig'
Expand All @@ -266,6 +270,7 @@ jobs:
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-openssl=$HOME/openssl/build --with-openssl-quic
--with-nghttp3=$HOME/nghttp3/build
--with-libuv
- name: quiche
configure: >-
Expand All @@ -275,6 +280,7 @@ jobs:
--with-quiche=$HOME/quiche/target/release
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
--with-ca-fallback
--with-libuv
- name: quiche
PKG_CONFIG_PATH: '$HOME/quiche/target/release'
Expand All @@ -284,6 +290,7 @@ jobs:
-DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
-DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
-DCURL_CA_FALLBACK=ON
-DCURL_USE_LIBUV=ON
steps:
- name: 'install prereqs'
Expand All @@ -295,7 +302,7 @@ jobs:
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \
texinfo texlive texlive-extra-utils autopoint libev-dev \
texinfo texlive texlive-extra-utils autopoint libev-dev libuv1-dev \
apache2 apache2-dev libnghttp2-dev vsftpd
python3 -m venv $HOME/venv
echo 'CC=gcc-12' >> $GITHUB_ENV
Expand Down Expand Up @@ -490,9 +497,10 @@ jobs:
source $HOME/venv/bin/activate
python3 -m pip install -r tests/http/requirements.txt
- name: 'run pytest'
- name: 'run pytest event based'
env:
TFLAGS: '${{ matrix.build.tflags }}'
CURL_TEST_EVENT: 1
CURL_CI: github
PYTEST_ADDOPTS: '--color=yes'
run: |
Expand Down
3 changes: 2 additions & 1 deletion lib/vtls/gtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1951,8 +1951,9 @@ static CURLcode gtls_connect_common(struct Curl_cfilter *cf,
*done = FALSE;
return CURLE_OK;
}
*done = ((connssl->connecting_state == ssl_connect_1) ||
*done = ((connssl->state == ssl_connection_complete) ||
(connssl->state == ssl_connection_deferred));
CURL_TRC_CF(data, cf, "gtls_connect_common() -> %d, done=%d", result, *done);
return result;
}

Expand Down

0 comments on commit 952770d

Please sign in to comment.