Mainline builds of HAProxy with QUIC enabled (using static QuicTLS builds)
Go to file
2023-02-14 16:14:35 +00:00
deps Update QuicTLS to OpenSSL 1.1.1t 2023-02-09 13:01:08 +00:00
haproxy Upgrade 2.7-stable to 1065b10 2023-02-14 16:14:35 +00:00
tool Add convenience debian scratch env setup script 2022-06-23 15:23:48 +02:00
.dockerignore Add docker publication back 2022-06-06 08:14:11 +01:00
.editorconfig Change build image to Debian Buster as reasonable glibc base (2.28) 2022-06-07 01:44:23 +01:00
.gitignore Add Debian packaging 2022-06-07 10:46:39 +01:00
.gitlab-ci.yml Upgrade 2.7-stable to 1065b10 2023-02-14 16:14:35 +00:00
Dockerfile Ensure successful linking as part of docker image build 2022-06-07 01:47:05 +01:00
LICENSE Add license 2022-06-06 06:07:49 +01:00
Makefile Fix QuicTLS & HAProxy linking, run regtests in CI 2022-06-14 05:34:19 +01:00
README.md Update README to mention that stable version are now major.minor-stable-debian_codename 2023-02-09 13:04:40 +00:00

HAProxy

Build scripts for HAProxy with QUIC

PROJECT STATUS: STABLE. We have been using it in our own production systems for months now without issues. If you rely on it for critical purposes, maintain your own fork, so that a potential tagging/CI issue doesn't cause you problems.

[[TOC]]

Quickstart

docker run -it \
    -v /path/to/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro \
    -p "80:80" \
    -p "443:443/tcp" \
    -p "443:443/udp" \
    registry.gitlab.com/mangadex-pub/haproxy:2.7-stable-bullseye

HTTP/3 and QUIC

NOTE FOR QUIC: docker and docker-compose require explicit UDP protocol port mapping, otherwise they assume only-TCP. See the explicit port-mapping above.

Here's a sample configuration (requires you to figure out the certificate) to test HTTP/3.0 support. The first connection should be over HTTP/1.1 or HTTP/2, and after a few refreshes it should be over HTTP/3.

See Announcing HAProxy 2.6 for more info.

...
frontend https
    bind       :443 ssl crt /usr/local/etc/haproxy/cert.pem alpn h2,http/1.1
    bind quic4@:443 ssl crt /usr/local/etc/haproxy/cert.pem alpn h3

    http-after-response set-header alt-svc 'h3=":443"; ma=86400'
    http-request return status 200 content-type text/plain lf-string "Connected via %HV"

Build it

You will need the following dependencies (Debian/Ubuntu packages given as example):

  • Development tools (build-essential)
  • curl and ssl support for it (curl and ca-certificates)
  • CMake (cmake)
  • Readline library headers (libreadline-dev)
  • Libsystemd headers (libsystemd-dev)
  • GNU TAR (tar)

Then just run make and the build should pass.

First, deps/quictls/quictls-dist.tar.gz should be expanded so it matches the host's /opt/quictls when expanding, as it is where HAProxy will look for OpenSSL.

And finally haproxy/haproxy-dist.tar.gz can be expanded anywhere.

Compatibility of binaries

You may acquire binaries for non-docker usage in 2 ways:

  • We distribute binary tarballs for this repo in the project's packages
  • You can build it locally, which results in deps/quictls/quictls-dist.tar.gz and haproxy/haproxy-dist.tar.gz

Please note that neither QuicTLS/OpenSSL nor HAProxy are fully statically compiled. They are still linking to glibc. You see that with readelf -d /path/to/binary.

As a result, you may be unable to run a binary linked using a more recent glibc.

Our CI uses the most recent Debian Buster image for compilation. You can find out the exact libc version this links against with ldd --version like so:

$ docker run -it debian:buster ldd --version | head -n1
ldd (Debian GLIBC 2.28-10+deb10u1) 2.28

Particular care should thus be put in what host you use for compilation.

Similarly, if you generally enjoy running abandonware you will not be able to use any of our non-docker artifacts.

Should I use this repo?

This is an:

  • unofficial build of HAProxy
  • which enables an experimental feature of HAProxy
  • which relies on an unofficial build of OpenSSL
  • which is based on an unofficial patch of OpenSSL

Generally speaking, you shouldn't.

That said, please PR improvements back if you do. We'll be using it ourselves too.

What's in there

First, we want to statically build things where possible, which is done for:

  • LUA
  • PCRE2
  • QuicTLS (partially, still links to host glibc)

Then we want HAProxy to not use the system's OpenSSL but rather our QuicTLS build, which it will look for at the /opt/quictls prefix.

About Debian packaging

The content of haproxy/debian is a slightly modified version of the Debian HAProxy Team's work and essentially all credits wrt that is due to them.

It is sourced from haproxy-team/haproxy:experimental-2.6

Notes

Since we're building our own binaries, we also increase MAX_SESS_STKCTR to 5 instead of the default of 3. If you don't know what that is, it's irrelevant to you. You can read some more here.