Skip to content

Commit 8296a69

Browse files
Fix build issue with openssl-1.1 (From Kurt Roeckx)
1 parent 869efa4 commit 8296a69

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Release/src/websockets/client/ws_client_wspp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,15 @@ class wspp_callback_client : public websocket_client_callback_impl, public std::
212212
return rfc2818(preverified, verifyCtx);
213213
});
214214

215+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
215216
// OpenSSL stores some per thread state that never will be cleaned up until
216217
// the dll is unloaded. If static linking, like we do, the state isn't cleaned up
217218
// at all and will be reported as leaks.
218219
// See http://www.openssl.org/support/faq.html#PROG13
219220
// This is necessary here because it is called on the user's thread calling connect(...)
220221
// eventually through websocketpp::client::get_connection(...)
221222
ERR_remove_thread_state(nullptr);
223+
#endif
222224

223225
return sslContext;
224226
});
@@ -382,11 +384,14 @@ class wspp_callback_client : public websocket_client_callback_impl, public std::
382384
crossplat::JVM.load()->DetachCurrentThread();
383385
#endif
384386

387+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
385388
// OpenSSL stores some per thread state that never will be cleaned up until
386389
// the dll is unloaded. If static linking, like we do, the state isn't cleaned up
387390
// at all and will be reported as leaks.
388391
// See http://www.openssl.org/support/faq.html#PROG13
389392
ERR_remove_thread_state(nullptr);
393+
#endif
394+
390395
});
391396
return pplx::create_task(m_connect_tce);
392397
}

0 commit comments

Comments
 (0)