During build phase:
In file included from /wrkdirs/usr/ports/net-im/tg_owt/work/tg_owt-91d836d/src/rtc_base/openssl_stream_adapter.cc:20:
/usr/local/include/openssl/dtls1.h:112:2: error: unknown type name 'SSL_SESSION'
/usr/local/include/openssl/dtls1.h:175:2: error: unknown type name 'SSL3_BUFFER'
/usr/local/include/openssl/dtls1.h:176:2: error: unknown type name 'SSL3_RECORD'
3 errors generated.
Created attachment 227283 [details]
Adds libressl headers and ifdefs
Solves the build.
Tested on amd64 14-CURRENT main-20d728b55 Poudriere jail.
So if I understand your patch correctly, you removes support for DTLS 1.2, if LIBRESSL is used.
Per https://en.wikipedia.org/wiki/Datagram_Transport_Layer_Security, it seems to be supported since version 3.3.2 (https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.3.2-relnotes.txt)
The ports version seems to be 3.3.3: https://www.freshports.org/security/libressl
What's your LIBRESSL_VERSION_NUMBER? Does the port build with newer libressl?
Yes, it builds. I'm on security/libressl-devel 3.3.3
Although I've written a different patch with DTLS 1.2 in mind (thank you for the review), I couldn't get it to work with Telegram Desktop, since Open and LibreSSL are now API incompatible.
I'll close the bug, since the main target of the port won't work in any way.