CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
fi
+# Requiring boost >= 1.66.
+AC_CHECK_HEADERS(boost/asio/io_context.hpp,,AC_MSG_ERROR([Missing boost asio io_context header: boost version must be at least 1.66]))
+
# Some boost headers need the <utility> header to be included for some Boost versions under C++20.
# Include it in all situations for simplicity.
AC_CHECK_HEADERS(
boost/date_time/posix_time/posix_time_types.hpp \
boost/foreach.hpp \
boost/functional/hash.hpp \
+ boost/integer/common_factor.hpp \
boost/interprocess/sync/interprocess_upgradable_mutex.hpp \
boost/shared_ptr.hpp \
boost/system/error_code.hpp \
]]
)
-AC_CHECK_HEADERS(boost/integer/common_factor.hpp)
-
-AC_CHECK_HEADERS(boost/asio/io_context.hpp,,AC_MSG_ERROR([Missing boost asio io_context header: boost version must be at least 1.66]))
-
# Verify that the path does not include standard headers by mistake.
# There are two regex.h headers: one is a standard system header (usually
# in /usr/include) and the second one is provided by boost. If you specify the
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <boost/asio/ssl.hpp>],
[auto ctx(boost::asio::ssl::context::tls);])],
- [AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_GENERIC_TLS_METHOD], [1],
- [Define to 1 if boost::asio::ssl::context::tls is available])],
+ [AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
- AC_MSG_CHECKING([Verifying TLS 1.2 fallback])
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([#include <boost/asio/ssl.hpp>],
- [auto ctx(boost::asio::ssl::context::tlsv12);])],
- [AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_TLS_1_2_METHOD], [1],
- [Define to 1 if boost::asio::ssl::context::tlsv12 is available])],
- [AC_MSG_RESULT(no)
- AC_MSG_WARN([The boost version is very old: TLS support can use insecure features])])])
+ AC_MSG_ERROR([Boost version >= 1.66 is required])])
dnl Check if the stream_truncated (SSL short read) error is available
AC_MSG_CHECKING([stream_truncated (SSL short read) error])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <boost/asio/ssl.hpp>],
[const int ec =
boost::asio::ssl::error::stream_truncated;])],
- [AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_STREAM_TRUNCATED_ERROR], [1],
- [Define to 1 if boost::asio::ssl::error::stream_truncated is available])],
+ [AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([#include <boost/asio/ssl.hpp>],
- [const int ec =
- ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ);])],
- [],
- [AC_MSG_ERROR([Can not find a definition for stream_truncated (SSL short read) error: sorry, your boost library is too old])])])
+ AC_MSG_ERROR([Boost version >= 1.66 is required])])
CPPFLAGS=${CPPFLAGS_SAVED}
fi
])
/* Whether gtest defines edit_distance::CreateUnifiedDiff */
#mesondefine HAVE_CREATE_UNIFIED_DIFF
-/* Whether boost::asio::ssl::context::tls is available */
-#mesondefine HAVE_GENERIC_TLS_METHOD
-
/* gss_str_to_oid is available */
#mesondefine HAVE_GSS_STR_TO_OID
/* Whether sockaddr has a sa_len member, and corresponding sin_len and sun_len */
#mesondefine HAVE_SA_LEN
-/* Whether boost::asio::ssl::error::stream_truncated is available */
-#mesondefine HAVE_STREAM_TRUNCATED_ERROR
-
/* Whether you have the <sys/filio.h> header file. */
#mesondefine HAVE_SYS_FILIO_H
endif
endif
-result = cpp.run(
- fs.read('compiler-checks/have-generic-tls-method.cc'),
- name: 'HAVE_GENERIC_TLS_METHOD',
- dependencies: [boost_dep, CRYPTO_DEP, threads_dep],
-)
-conf_data.set('HAVE_GENERIC_TLS_METHOD', result.returncode() == 0)
+if CRYPTO_DEP.name() == openssl.name()
+ cpp.run(
+ fs.read('compiler-checks/have-generic-tls-method.cc'),
+ name: 'HAVE_GENERIC_TLS_METHOD',
+ dependencies: [boost_dep, CRYPTO_DEP, threads_dep],
+ required: true,
+ )
+ cpp.run(
+ fs.read('compiler-checks/stream-truncated-error.cc'),
+ name: 'HAVE_STREAM_TRUNCATED_ERROR',
+ dependencies: [boost_dep, CRYPTO_DEP, threads_dep],
+ required: true,
+ )
+endif
result = cpp.run(
fs.read('compiler-checks/have-optreset.cc'),
conf_data.set('HAVE_MYSQL_GET_OPTION', result.returncode() == 0)
endif
-result = cpp.run(
- fs.read('compiler-checks/stream-truncated-error.cc'),
- name: 'HAVE_STREAM_TRUNCATED_ERROR',
- dependencies: [boost_dep, CRYPTO_DEP, threads_dep],
-)
-conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', result.returncode() == 0)
-
# TODO: implement when integrating with CI
result = cpp.run(
fs.read('compiler-checks/fuzzing-with-clusterfuzzlite.cc'),
// the boost version is older than 1.64.0).
TlsContext::TlsContext(TlsRole role)
: TlsContextBase(role), cert_required_(true),
-#ifdef HAVE_GENERIC_TLS_METHOD
context_(context::method::tls)
-#else
-#ifdef HAVE_TLS_1_2_METHOD
- context_(context::method::tlsv12)
-#else
- context_(context::method::tlsv1)
-#endif
-#endif
{
// Not leave the verify mode to OpenSSL default.
setCertRequired(true);
-// Copyright (C) 2021-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2021-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
};
// Stream truncated error code.
-#ifdef HAVE_STREAM_TRUNCATED_ERROR
const int STREAM_TRUNCATED = boost::asio::ssl::error::stream_truncated;
-#else
-const int STREAM_TRUNCATED = ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ);
-#endif
} // namespace asiolink
} // namespace isc
#include <config.h>
#include <iostream>
-
-#ifdef HAVE_GENERIC_TLS_METHOD
-
#include <cstdlib>
#include <cstring>
#include <functional>
return 0;
}
-#else // !HAVE_GENERIC_TLS_METHOD
-
-int main()
-{
- std::cerr << "this tool requires recent boost version (>= 1.64)\n";
- return 0;
-}
-#endif
#include <config.h>
#include <iostream>
-
-#ifdef HAVE_GENERIC_TLS_METHOD
-
#include <cstdlib>
#include <boost/bind/bind.hpp>
return 0;
}
-
-#else // !HAVE_GENERIC_TLS_METHOD
-
-int main()
-{
- std::cerr << "this tool requires recent boost version (>= 1.64)\n";
- return 0;
-}
-#endif
-