Le protocole HTTP3

Apache et d’autres serveurs http peuvent retourner une réponse différente si nous utilisons le protocole HTTP3. Ce n’est pas un protocole fréquemment utilisé et les clients HTTP3 sont plutôt rares. L’utilitaire curl supporte ce protocole, mais il faut le compiler avec les options nécessaires. Voici une façon de compiler les librairies nécessaires et de construire curl pour qu’il connaisse ce protocole


apt install libtool
apt install autoconf
cd
home=`pwd`
mkdir $home/http3
mkdir $home/http3/build
cd $home/http3
opensslbuild=$home/http3/build/opensslbuild
nghttp3build=$home/http3/build/nghttp3build
ngtcp2build=$home/http3/build/ngtcp2build

Build openssl


 git clone --depth 1 -b OpenSSL_1_1_1k+quic https://github.com/quictls/openssl
 cd openssl
 ./config enable-tls1_3 --prefix=$opensslbuild
 make -j
 make install_sw

Build nghttp3


 cd ..
 git clone https://github.com/ngtcp2/nghttp3
 cd nghttp3
 autoreconf -i
 ./configure --prefix=$nghttp3build --enable-lib-only
 make -j
 make install

Build ngtcp2


 cd ..
 git clone https://github.com/ngtcp2/ngtcp2
 cd ngtcp2
 autoreconf -i
 ./configure PKG_CONFIG_PATH=$opensslbuild/lib/pkgconfig:$nghttp3build/lib/pkgconfig LDFLAGS="-Wl,-rpath,$opensslbuild/lib" --prefix=$ngtcp2build --enable-lib-only
 make -j
 make install

Build curl


 cd ..
 git clone https://github.com/curl/curl
 cd curl
 ./buildconf
 LDFLAGS="-Wl,-rpath,$opensslbuild/lib" ./configure --with-openssl=$opensslbuild --with-nghttp3=$nghttp3build --with-ngtcp2=$ngtcp2build
 make -j

$home/http3/curl/src/curl --http3 https://myhttp3host.com

Leave a Reply