Installing cURL with PQC support

By | December 5, 2026

Assuming that the OpenSSL 3.5.9 has been installed in the WSL2. Then do the sanity check first

ls -l /opt/openssl-3.5.9/include/openssl/ssl.h
ls -l /opt/openssl-3.5.9/lib/pkgconfig/openssl.pc
PKG_CONFIG_PATH=/opt/openssl-3.5.9/lib/pkgconfig \
pkg-config --modversion openssl
ls -lh /etc/ssl/certs/ca-certificates.crt
dpkg -s ca-certificates | grep Status

check the build prerequisite

gcc --version
make --version
pkg-config --version
dpkg -s build-essential pkg-config zlib1g-dev 2>/dev/null |
grep -E '^Package:|^Status:'

Download the source tarball

wget https://curl.se/download/curl-8.23.0.tar.xz
tar -xf curl-8.23.0.tar.xz
cd curl-8.23.0

Let’s install cURL with all expanded capabilities.

sudo apt install \
  libpsl-dev \
  libbrotli-dev \
  libzstd-dev \
  libnghttp2-dev \
  libc-ares-dev

Check the installation

At this point, these are ready

libpsl       ✓
Brotli       ✓
Zstd         ✓
HTTP/2       ✓
c-ares       ✓
OpenSSL 3.5.9 ✓

HTTP/3       not yet

Check the build tools to support HTTP/3

git --version
autoconf --version | head -1
automake --version | head -1
libtoolize --version | head -1
pkg-config --version
make --version | head -1
gcc --version | head -1

Then install all required objects

sudo apt install \
  git \
  autoconf \
  automake \
  autotools-dev \
  libtool

Setup the clone

export NGHTTP3_VERSION=1.18.0
export NGHTTP3_PREFIX=/opt/nghttp3-$NGHTTP3_VERSION
git clone \
  --depth 1 \
  --branch v$NGHTTP3_VERSION \
  https://github.com/ngtcp2/nghttp3.git \
  nghttp3-$NGHTTP3_VERSION
cd ~/Downloads/nghttp3-1.18.0

Setup the environment then configure it

Install as the library only

./configure \
  --prefix="$NGHTTP3_PREFIX" \
  --enable-lib-only
make -j16
sudo make install
sudo ln -sfn \
  /opt/nghttp3-1.18.0 \
  /opt/nghttp3
readlink -f /opt/nghttp3
export OPENSSL_PQC=/opt/openssl-3.5.9
export CURL_PQC=/opt/curl-pqc
PKG_CONFIG_PATH="$OPENSSL_PQC/lib/pkgconfig" \
CPPFLAGS="-I$OPENSSL_PQC/include" \
LDFLAGS="-L$OPENSSL_PQC/lib -Wl,-rpath,$OPENSSL_PQC/lib" \
./configure \
  --prefix="$CURL_PQC" \
  --with-openssl="$OPENSSL_PQC" \
  --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
  --with-ca-path=/etc/ssl/certs \
  --with-zlib \
  --disable-shared \
  --enable-static

the HTTP/3 is ready

Let’s prepare ngtcp2 1.25.0 for OpenSSL 3.5.9

Then check whether the OpenSSL, ngtcp2 (QUIC) and the libnghttp3 (HTTP/3) already installed

let’s configure it

PKG_CONFIG_PATH="/opt/openssl-3.5.9/lib/pkgconfig:/opt/nghttp3/lib/pkgconfig" \
LDFLAGS="-Wl,-rpath,/opt/openssl-3.5.9/lib -Wl,-rpath,/opt/nghttp3/lib" \
./configure \
  --prefix="$NGTCP2_PREFIX" \
  --enable-lib-only \
  --with-openssl

then final check whether openssl already configured with HTTP/3 and NGTCP2

install them all!

make -j16
sudo make install
sudo ln -sfn \
  /opt/ngtcp2-1.25.0 \
  /opt/ngtcp2

Final check

all libraries HTTP/3 and QUIC already installed. Back to the curl source folder

PKG_CONFIG_PATH="/opt/openssl-3.5.9/lib/pkgconfig:/opt/nghttp3/lib/pkgconfig:/opt/ngtcp2/lib/pkgconfig" \
CPPFLAGS="-I/opt/openssl-3.5.9/include" \
LDFLAGS="-L/opt/openssl-3.5.9/lib \
-L/opt/nghttp3/lib \
-L/opt/ngtcp2/lib \
-Wl,-rpath,/opt/openssl-3.5.9/lib \
-Wl,-rpath,/opt/nghttp3/lib \
-Wl,-rpath,/opt/ngtcp2/lib" \
./configure \
  --prefix=/opt/curl-pqc \
  --with-openssl=/opt/openssl-3.5.9 \
  --with-ngtcp2=/opt/ngtcp2 \
  --with-nghttp3=/opt/nghttp3 \
  --with-nghttp2 \
  --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
  --with-ca-path=/etc/ssl/certs \
  --with-zlib \
  --with-brotli \
  --with-zstd \
  --with-libpsl \
  --enable-ares \
  --enable-ssls-export \
  --enable-proxy-http3 \
  --disable-shared \
  --enable-static \
  --disable-ech \
  --disable-httpsrr
make -j16

check the output, the old cURL is not impacted

test the HTTP/2

curl-pqc -vI --http2 https://www.cloudflare.com/

test it for HTTP/3

curl-pqc -vI --http3-only https://cloudflare-quic.com/

Done!

Category: pqc

Leave a Reply

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.