Skip to content

Commit c8c1c3d

Browse files
committed
Fix #1442
1 parent 9f512ac commit c8c1c3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

httplib.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ using socket_t = int;
255255

256256
#if OPENSSL_VERSION_NUMBER < 0x1010100fL
257257
#error Sorry, OpenSSL versions prior to 1.1.1 are not supported
258+
#elif OPENSSL_VERSION_NUMBER < 0x30000000L
259+
#define SSL_get1_peer_certificate SSL_get_peer_certificate
258260
#endif
259261

260262
#endif
@@ -7716,7 +7718,7 @@ inline bool SSLClient::initialize_ssl(Socket &socket, Error &error) {
77167718
return false;
77177719
}
77187720

7719-
auto server_cert = SSL_get_peer_certificate(ssl2);
7721+
auto server_cert = SSL_get1_peer_certificate(ssl2);
77207722

77217723
if (server_cert == nullptr) {
77227724
error = Error::SSLServerVerification;

0 commit comments

Comments
 (0)