Neil Horman 15f859403e Fix sizing on variable in ossl-nghttp3-demo-server
On working on a rebase for the quic-server branch, I noted that the
rebase was failing on the http3 server.  It occurs because the new CI
ubuntu container appears to have FORTIFY_SOURCE enabled and trips over
the call to read here.  Specifically the compiler notes that in passing
an int into the read syscall (which accepts a size_t as the 3rd
argument), may interpret a negative value as a very large unsigned value
that exeeds the size allowed by a read call.

Fix it by converting the size variable to a size_t to ensure that the
signing is correct

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26368)
2025-02-17 11:27:33 -05:00
..
2024-09-05 09:35:49 +02:00
2024-04-09 13:43:26 +02:00
2024-11-13 17:24:40 +01:00
2023-11-08 11:12:55 +11:00

HTTP/3 Demo using OpenSSL QUIC and nghttp3

This is a simple demo of how to use HTTP/3 with OpenSSL QUIC using the HTTP/3 library “nghttp3”.

The demo is structured into two parts:

  • an adaptation layer which binds nghttp3 to OpenSSL's QUIC implementation (ossl-nghttp3.c);
  • a simple application which makes an HTTP/3 request using this adaptation layer (ossl-nghttp3-demo.c).

The Makefile in this directory can be used to build the demo on *nix-style systems. You will need the nghttp3 library and header file. On Ubuntu, these can be obtained by installing the package libnghttp3-dev.

Running the Demo

Depending on your system configuration it may be necessary to set the SSL_CERT_FILE or SSL_CERT_DIR environment variables to a location where trusted root CA certificates can be found.

After building by running make, run ./ossl-nghttp3-demo with a hostname and port as the sole argument:

$ make
$ LD_LIBRARY_PATH=../.. ./ossl-nghttp3-demo www.google.com:443

The demo produces the HTTP response headers in textual form as output followed by the response body.

See Also