Skip to content
Snippets Groups Projects
Commit 1419afd9 authored by Bartolomeo Berend Müller's avatar Bartolomeo Berend Müller
Browse files

Delete old experiment

parent de5409c7
No related branches found
No related tags found
No related merge requests found
# This curl version cannot connect to localhost with http3, and the reason is unknown to me, outside of the container it works fine.
ARG INSTALL_DIR=/app/.local/
FROM debian:bookworm-slim
ARG INSTALL_DIR
WORKDIR /app
RUN apt update && apt install -y pkg-config \
libev-dev \
git \
build-essential \
automake \
libtool \
ninja-build \
libssl-dev \
libpcre3-dev \
wget \
cmake
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${INSTALL_DIR}/openssl/lib64
RUN git clone --depth 1 -b openssl-3.1.4+quic https://github.com/quictls/openssl
WORKDIR /app/openssl
RUN ./config enable-tls1_3 --prefix=${INSTALL_DIR}/openssl && \
make && \
make install_sw install_ssldirs
WORKDIR /app
RUN git clone --no-checkout --single-branch --branch main https://github.com/open-quantum-safe/liboqs.git
WORKDIR /app/liboqs
RUN git checkout d2089c5017fc45f4dce2f6516b3e9ad337946600
RUN cmake -GNinja -DOPENSSL_ROOT_DIR=${INSTALL_DIR}/openssl -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/liboqs -S . -B build
WORKDIR /app/liboqs/build
RUN ninja && ninja install
WORKDIR /app
RUN git clone --no-checkout --single-branch --branch main https://github.com/open-quantum-safe/oqs-provider.git
WORKDIR /app/oqs-provider
RUN git checkout 8f37521d5e27ab4d1e0d69a4b4a5bd17927b24b9
RUN liboqs_DIR=${INSTALL_DIR}/liboqs cmake -DOPENSSL_ROOT_DIR=${INSTALL_DIR}/openssl -S . -B build && cmake --build build
RUN cp build/lib/oqsprovider.so ${INSTALL_DIR}/openssl/lib64/ossl-modules/
WORKDIR /app
RUN sed -i "s/default = default_sect/default = default_sect\noqsprovider = oqsprovider_sect/g" ${INSTALL_DIR}/openssl/ssl/openssl.cnf && \
sed -i "s/\[default_sect\]/\[default_sect\]\nactivate = 1\n\[oqsprovider_sect\]\nactivate = 1\n/g" ${INSTALL_DIR}/openssl/ssl/openssl.cnf
RUN git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3
WORKDIR /app/nghttp3
RUN git submodule update --init && \
autoreconf -fi && \
./configure --prefix=${INSTALL_DIR}/nghttp3 --enable-lib-only && \
make && \
make install
WORKDIR /app
RUN git clone -b v1.2.0 https://github.com/ngtcp2/ngtcp2
WORKDIR /app/ngtcp2
RUN autoreconf -fi && \
./configure PKG_CONFIG_PATH=${INSTALL_DIR}/openssl/lib64/pkgconfig:${INSTALL_DIR}/nghttp3/lib/pkgconfig LDFLAGS="-Wl,-rpath,${INSTALL_DIR}/openssl/lib64" --prefix=${INSTALL_DIR}/ngtcp2 --enable-lib-only && \
make && \
make install
WORKDIR /app
RUN wget https://curl.se/download/curl-8.8.0.tar.gz && \
tar -zxvf curl-8.8.0.tar.gz
WORKDIR /app/curl-8.8.0
RUN LDFLAGS="-Wl,-rpath,${INSTALL_DIR}/openssl/lib64" ./configure --prefix=${INSTALL_DIR}/curl --with-openssl=${INSTALL_DIR}/openssl --with-nghttp3=${INSTALL_DIR}/nghttp3 --with-ngtcp2=${INSTALL_DIR}/ngtcp2 && \
make && \
make install
WORKDIR /app
build:
docker build -t curl-quic-pqc-client .
run:
docker run --rm -it --network host curl-quic-pqc-client
quic_client: quic_client.c
gcc -Itmp/ngtcp2/lib/includes -Itmp/ngtcp2/crypto/includes -o $@ $< -lssl -lcrypto -lstdc++ -lpthread
clean:
rm -f quic_client
This directory contains information to install curl with http3 support. The Dockerfile works, but cannot call localhost due to a docker error. The install script works for a local version of curl.
\ No newline at end of file
#!/bin/bash
set -ex
mkdir -p tmp
# Set the working directory
WORKDIR=$(pwd)/tmp
INSTALL_DIR=${WORKDIR}/.local
cd ${WORKDIR}
# Install dependencies
sudo apt update && sudo apt install -y pkg-config \
libev-dev \
git \
build-essential \
automake \
libtool \
ninja-build \
libssl-dev \
libpcre3-dev \
wget \
cmake
# Clone and build OpenSSL
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${WORKDIR}/openssl
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${INSTALL_DIR}/openssl/lib64
git clone --depth 1 -b openssl-3.1.4+quic https://github.com/quictls/openssl
cd ${WORKDIR}/openssl
LDFLAGS="-Wl,-rpath -Wl,${INSTALL_DIR}/openssl/lib64" ./Configure --prefix=${INSTALL_DIR}/openssl && \
make && \
make install_sw install_ssldirs
cd ${WORKDIR}
git clone --no-checkout --single-branch --branch main https://github.com/open-quantum-safe/liboqs.git
cd ${WORKDIR}/liboqs
git checkout d2089c5017fc45f4dce2f6516b3e9ad337946600
cmake -GNinja -DOPENSSL_ROOT_DIR=${INSTALL_DIR}/openssl -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/liboqs -S . -B build
cd ${WORKDIR}/liboqs/build
ninja && ninja install
cd ${WORKDIR}
git clone --no-checkout --single-branch --branch main https://github.com/open-quantum-safe/oqs-provider.git
cd ${WORKDIR}/oqs-provider
git checkout 8f37521d5e27ab4d1e0d69a4b4a5bd17927b24b9
liboqs_DIR=${INSTALL_DIR}/liboqs cmake -DOPENSSL_ROOT_DIR=${INSTALL_DIR}/openssl -S . -B build && cmake --build build
cp build/lib/oqsprovider.so ${INSTALL_DIR}/openssl/lib64/ossl-modules/
cd ${WORKDIR}
sed -i "s/default = default_sect/default = default_sect\noqsprovider = oqsprovider_sect/g" ${INSTALL_DIR}/openssl/ssl/openssl.cnf && \
sed -i "s/\[default_sect\]/\[default_sect\]\nactivate = 1\n\[oqsprovider_sect\]\nactivate = 1\n/g" ${INSTALL_DIR}/openssl/ssl/openssl.cnf
git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3
cd ${WORKDIR}/nghttp3
git submodule update --init && \
autoreconf -fi && \
./configure --prefix=${INSTALL_DIR}/nghttp3 --enable-lib-only && \
make && \
make install
cd ${WORKDIR}
git clone -b v1.2.0 https://github.com/ngtcp2/ngtcp2
cd ${WORKDIR}/ngtcp2
autoreconf -fi && \
./configure PKG_CONFIG_PATH=${INSTALL_DIR}/openssl/lib64/pkgconfig:${INSTALL_DIR}/nghttp3/lib/pkgconfig LDFLAGS="-Wl,-rpath,${INSTALL_DIR}/openssl/lib64" --prefix=${INSTALL_DIR}/ngtcp2 --enable-lib-only && \
make && \
make install
cd ${WORKDIR}
# When using openssl, without quic (not quictls), it ain't working
# configure: error: the detected TLS library does not support QUIC, making --with-ngtcp2 a no-no
wget https://curl.se/download/curl-8.8.0.tar.gz && \
tar -zxvf curl-8.8.0.tar.gz
cd ${WORKDIR}/curl-8.8.0
LDFLAGS="-Wl,-rpath,${INSTALL_DIR}/openssl/lib64" ./configure --prefix=${INSTALL_DIR}/curl --with-openssl=${INSTALL_DIR}/openssl --with-nghttp3=${INSTALL_DIR}/nghttp3 --with-ngtcp2=${INSTALL_DIR}/ngtcp2 && \
make && \
make install
cd ${WORKDIR}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment