Skip to content

Commit 253699c

Browse files
fix building with libressl
LibreSSL is backwards compatible with OpenSSL 1.0, however it reports it's version number as 2.0, which then causes build failures when using OPENSSL_VERSION_NUMBER. Adding a check for LIBRESSL_VERSION_NUMBER when checking if the openssl version number is < 0x10100000L fixes the issue.
1 parent f301d1d commit 253699c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Release/src/websockets/client/ws_client_wspp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static struct ASIO_SSL_memory_leak_suppress
7373
{
7474
~ASIO_SSL_memory_leak_suppress()
7575
{
76-
#if OPENSSL_VERSION_NUMBER < 0x10100000L
76+
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
7777
::SSL_COMP_free_compression_methods();
7878
#endif
7979
}
@@ -210,7 +210,7 @@ class wspp_callback_client : public websocket_client_callback_impl, public std::
210210
return rfc2818(preverified, verifyCtx);
211211
});
212212

213-
#if OPENSSL_VERSION_NUMBER < 0x10100000L
213+
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
214214
// OpenSSL stores some per thread state that never will be cleaned up until
215215
// the dll is unloaded. If static linking, like we do, the state isn't cleaned up
216216
// at all and will be reported as leaks.
@@ -382,7 +382,7 @@ class wspp_callback_client : public websocket_client_callback_impl, public std::
382382
crossplat::JVM.load()->DetachCurrentThread();
383383
#endif
384384

385-
#if OPENSSL_VERSION_NUMBER < 0x10100000L
385+
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
386386
// OpenSSL stores some per thread state that never will be cleaned up until
387387
// the dll is unloaded. If static linking, like we do, the state isn't cleaned up
388388
// at all and will be reported as leaks.

0 commit comments

Comments
 (0)