fix compilation with OPENSSL_LIBRARY=0

This commit is contained in:
Timur A. Fatkhullin 2024-12-12 21:34:12 +03:00
parent 4e133de5b2
commit e4fd86a6d4
2 changed files with 6 additions and 3 deletions

View File

@ -172,7 +172,9 @@ if (BUILD_TESTS)
set(NETSERVICE_TEST_APP adc_netservice_test) set(NETSERVICE_TEST_APP adc_netservice_test)
add_executable(${NETSERVICE_TEST_APP} tests/adc_netservice_test.cpp) add_executable(${NETSERVICE_TEST_APP} tests/adc_netservice_test.cpp)
target_link_libraries(${NETSERVICE_TEST_APP} OpenSSL::SSL OpenSSL::Crypto) if (OPENSSL_LIBRARY)
target_link_libraries(${NETSERVICE_TEST_APP} OpenSSL::SSL OpenSSL::Crypto)
endif()
if (ASIO_LIBRARY) if (ASIO_LIBRARY)
find_package(cxxopts CONFIG) find_package(cxxopts CONFIG)

View File

@ -159,7 +159,8 @@ public:
typedef std::function<int(const std::string& serial, const std::vector<unsigned char>& fingerprint, int depth)> typedef std::function<int(const std::string& serial, const std::vector<unsigned char>& fingerprint, int depth)>
cert_comp_func_t; cert_comp_func_t;
#else #else
using session_level_socket_t = socket_t; // using session_level_socket_t = socket_t;
using session_level_socket_t = std::nullptr_t;
#endif #endif
@ -830,8 +831,8 @@ protected:
asio::socket_base::shutdown_type _shutdownType = asio::socket_base::shutdown_both; asio::socket_base::shutdown_type _shutdownType = asio::socket_base::shutdown_both;
#ifdef USE_OPENSSL_WITH_ASIO
session_level_socket_t _sessSocket; session_level_socket_t _sessSocket;
#ifdef USE_OPENSSL_WITH_ASIO
std::conditional_t<isTLS, asio::ssl::context, std::nullptr_t> _tlsContext; std::conditional_t<isTLS, asio::ssl::context, std::nullptr_t> _tlsContext;
asio::ssl::verify_mode _tlsPeerVerifyMode; asio::ssl::verify_mode _tlsPeerVerifyMode;
cert_comp_func_t _tlsCertCompFunc; cert_comp_func_t _tlsCertCompFunc;