[ AC_MSG_ERROR([OpenSSL is too old. We require 1.0.1 or later. You can specify a path to a newer one with --with-openssl-dir.]) ])
AC_MSG_CHECKING([whether LibreSSL TLS 1.3 APIs are busted])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <openssl/opensslv.h>
#if defined(LIBRESSL_VERSION_NUMBER) && \
LIBRESSL_VERSION_NUMBER >= 0x3020100fL && \
LIBRESSL_VERSION_NUMBER < 0x3040100fL
#error "oh no"
#endif
]], [[]])],
[ AC_MSG_RESULT([no]) ],
[ AC_MSG_ERROR([This version of LibreSSL won't work with Tor. Please upgrade to LibreSSL 3.4.1 or later. (Or downgrade to 3.2.0 if you really must.)]) ])