Skip to content

Commit

Permalink
Display warning if crypto locking callbacks were not set
Browse files Browse the repository at this point in the history
  • Loading branch information
lganzzzo committed Nov 22, 2020
1 parent 21f88cf commit 02a94f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/oatpp-openssl/client/ConnectionProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ ConnectionProvider::ConnectionProvider(const std::shared_ptr<Config>& config,
setProperty(PROPERTY_HOST, streamProvider->getProperty(PROPERTY_HOST).toString());
setProperty(PROPERTY_PORT, streamProvider->getProperty(PROPERTY_PORT).toString());

auto calback = CRYPTO_get_locking_callback();
if(!calback) {
auto callback = CRYPTO_get_locking_callback();
if(!callback) {
OATPP_LOGD("[oatpp::openssl::client::ConnectionProvider::ConnectionProvider()]",
"WARNING. openssl. CRYPTO_set_locking_callback is NOT set. "
"This can cause problems using openssl in multithreaded environment! "
Expand Down
9 changes: 9 additions & 0 deletions src/oatpp-openssl/server/ConnectionProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ ConnectionProvider::ConnectionProvider(const std::shared_ptr<Config>& config,
setProperty(PROPERTY_HOST, streamProvider->getProperty(PROPERTY_HOST).toString());
setProperty(PROPERTY_PORT, streamProvider->getProperty(PROPERTY_PORT).toString());

auto callback = CRYPTO_get_locking_callback();
if(!callback) {
OATPP_LOGD("[oatpp::openssl::server::ConnectionProvider::ConnectionProvider()]",
"WARNING. openssl. CRYPTO_set_locking_callback is NOT set. "
"This can cause problems using openssl in multithreaded environment! "
"Please call oatpp::openssl::Callbacks::setDefaultCallbacks() or "
"consider setting custom locking_callback.");
}

instantiateTLSServer();

}
Expand Down

0 comments on commit 02a94f6

Please sign in to comment.