Meanwhile in #curl land, we can now do #HTTP3 with #ngtcp2 1.12.0 and #OpenSSL 3.5.

Thanks to lots of amazing people, including @icing and Tatsuhiro of ngtcp2 of course.

It looks like the #OpenSSL QUIC API might be supported in the coming #ngtcp2 1.12.0 release:

https://github.com/ngtcp2/ngtcp2/pull/1582

This could be exciting for #curl users building with #OpenSSL ...

Add libngtcp2_crypto_ossl, osslclient and osslserver by tatsuhiro-t · Pull Request #1582 · ngtcp2/ngtcp2

Add libngtcp2_crypto_ossl, osslclient and osslserver libngtcp2_crypto_ossl is an ngtcp2 crypto helper library for OpenSSL >= 3.5. If libngtcp2_crypto_ossl is used, an application must make sur...

GitHub
@nlnetlabs The build ain't as straightforward as we're used to. Why can't one just use #openssl with #ngtcp2 but instead need #quictls? I fear I sacrifice security by not using official OpenSSL libs for #quic
@bagder quite interesting details about quic support. It affects also DNS over QUIC, not only HTTPS/3. At least unbound and bind9 are compiled with OpenSSL on Fedora. Unbound has added recently server support via #ngtcp2. But it gets weird and inappropriate, linking two different crypto stacks into single binary. The reason is similar to curl. Normal TLS from OpenSSL, quic via gnutls. If it should be enabled, then this way...

An #ngtcp2 lead developer told me they have no current plans to adapt to the new #OpenSSL #QUIC API because of its lack of 0RTT support and the "pull model".

Of course someone else can go ahead and write it and ideally someone from #OpenSSL does it, for dogfooding purposes.

I have no heard of any other QUIC stack either having adapted to it yet.

I now hope for #OpenSSL to work with #ngtcp2 to make sure #QUIC works fine in that combo. Then we can leave the slow OpenSSL-QUIC implementation in its dusty corner and perhaps see rather wide HTTP/3 + curl adoption coming up.

#OpenSSL #QUIC implementation performance is "abysmal" compared to competing solutions such as #ngtcp2 (ngtcp2 is 2-4x faster) and consumes tons (up to 25x in some situations) of memory. (*)

I still don't fathom why the OpenSSL project chose the path they took. It smells heavily of "Not Invented Here" to me.

Surely some future OpenSSL version will fix this mess?

*) https://lists.haxx.se/pipermail/daniel/2025-January/000096.html

[Daniel's week] January 10, 2025

Until improved, I believe the sever performance degradation and memory use compared to #ngtcp2 are reasons enough for us to not recommend #OpenSSL QUIC for use with #curl in production.

Upload speed: ngtcp2 is 2-4x faster.

Memory use: in some tests, OpenSSL uses 25x the amount of memory.

Whoa, I just got a basic Python wrapper around ngtcp2 [server only] functional. Lots of error handling and edge cases need to be implemented.

The test that is working is a client (aioquic) connects, opens a stream, both sides send some data, and confirms that the other side received the data.

I really didn't think my last set of changes would make things work, I expected to hit some unimplemented parts.

TODO:
```
$ grep NotImplementedError ngtcp2.py | wc -l
15
```

#Python #ngtcp2

Обновился #OpenSSL до 3.4.0 и опять без полноценной нормальной поддержки #QUIC, т.е. непригодный для #HTTP/3 на серверной стороне. И, соответственно, ещё не ясно на сколько хорошо сделана клиентская часть :)
Аж вспомнились времена, когда желая получить #curl поддерживающий нормально работу #HTTP/3 приходилось собирать его из исходников с аналогами/форками #OpenSSL.

#HTTP/3 работает не через tcp-соединения, а использует в качестве транспорта протокол QUIC (Quick UDP Internet Connections), т.е. передаёт данные поверх udp без использования абстракций и сущностей tcp. Вот картинка про современный #HTTP

Сам по себе #QUIC не умеет передавать данные в открытом виде, а может только через #TLS v1.3, т.е. в обязательном порядке только зашифрованные. Тем самым в QUIC используется встроенный вариант TLS 1.3 крайне близкий/схожий с #DTLS, поскольку работа протокола идёт на уровне обмена udp-пакетами, а не tcp-соединений.

#curl может использовать разные альтернативы OpenSSL, т.к. изначально спроектирован таким образом, что не завязан именно на OpenSSL:
Что предлагают по HTTP/3 авторы curl?
Вот зелёным выделена комбинация библиотек, которую полагают наиболее стабильным и полноценным вариантом
Вся загвоздка в том, что #OpenSSL пытается содержать в себе реализацию #QUIC, а не использует реализацию в виде какой-то библиотеки.

Что получается в целом?
Протокол #HTTP/3 реализуется через библиотеку #nghttp3.
Необходимая реализация #QUIC через #ngtcp2.
А для TLS используется #GnuTLS или же #wolfSSL или что-то ещё:
The OpenSSL forks #LibreSSL, #BoringSSL, #AWS-LC and #quictls support the QUIC API that #curl works with using #ngtcp2.
Вот из документация примеры и детали по сборке этих составляющих. Если выбрана #GnuTLS и в системе версия далёкая от свежих, то сама она довольно быстро собирается из исходников.

В целом, вообще, про варианты добавления поддержки #HTTP/3 очень достойно расписано здесь. И есть перевод этой публикации на русском языке.

#https #http #openssl #softwaredevelopment #lang_ru @Russia
Hubzilla.de