diff --git a/src/crypto.cpp b/src/crypto.cpp index b16ab08a..2b30a3bc 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -4,6 +4,7 @@ */ #include "crypto.h" #include +#include namespace crypto { using asn1_string_t = util::safe_ptr; diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index fbdbd051..ea9248e7 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -1033,7 +1033,13 @@ namespace nvhttp { // Verify certificates after establishing connection https_server.verify = [add_cert](SSL *ssl) { - crypto::x509_t x509 { SSL_get_peer_certificate(ssl) }; + crypto::x509_t x509 { +#if OPENSSL_VERSION_MAJOR >= 3 + SSL_get1_peer_certificate(ssl) +#else + SSL_get_peer_certificate(ssl) +#endif + }; if (!x509) { BOOST_LOG(info) << "unknown -- denied"sv; return 0;