Skip to content

Commit

Permalink
fix(openssl): fix build with OPENSSL_NO_DEPRECATED (#3339)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman authored Oct 30, 2024
1 parent 79ada18 commit ca40cfd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
#include "crypto.h"
#include <openssl/pem.h>
#include <openssl/rsa.h>

namespace crypto {
using asn1_string_t = util::safe_ptr<ASN1_STRING, ASN1_STRING_free>;
Expand Down
8 changes: 7 additions & 1 deletion src/nvhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ca40cfd

Please sign in to comment.