From c8c1c3d376715666eb665c6011933b783876201d Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 1 Dec 2022 13:38:58 -0500 Subject: [PATCH] Fix #1442 --- httplib.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index 3b069b0..c32e2de 100644 --- a/httplib.h +++ b/httplib.h @@ -255,6 +255,8 @@ using socket_t = int; #if OPENSSL_VERSION_NUMBER < 0x1010100fL #error Sorry, OpenSSL versions prior to 1.1.1 are not supported +#elif OPENSSL_VERSION_NUMBER < 0x30000000L +#define SSL_get1_peer_certificate SSL_get_peer_certificate #endif #endif @@ -7716,7 +7718,7 @@ inline bool SSLClient::initialize_ssl(Socket &socket, Error &error) { return false; } - auto server_cert = SSL_get_peer_certificate(ssl2); + auto server_cert = SSL_get1_peer_certificate(ssl2); if (server_cert == nullptr) { error = Error::SSLServerVerification;