Skip to content

Commit 391ade2

Browse files
committed
Add more logging
1 parent a52c755 commit 391ade2

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

include/ccapi_cpp/service/ccapi_fix_service.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@ class FixService : public Service {
168168
}
169169

170170
if constexpr (std::is_same_v<StreamType, beast::ssl_stream<beast::tcp_stream>>) {
171-
if (!SSL_set_tlsext_host_name(streamPtr->native_handle(), fixConnectionPtr->host.c_str())) {
171+
if (!CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name for host " + host + ": " + ec.message());
172+
(streamPtr->native_handle(), fixConnectionPtr->host.c_str())) {
172173
beast::error_code ec{static_cast<int>(::ERR_get_error()), net::error::get_ssl_category()};
173-
CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name: " + ec.message());
174+
CCAPI_LOGGER_DEBUG("error CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name for host " + host + ": " + ec.message());: " + ec.message());
174175
this->onError(Event::Type::FIX_STATUS, Message::Type::FIX_FAILURE, ec, "set SNI Hostname", {fixConnectionPtr->subscription.getCorrelationId()});
175176
return;
176177
}

include/ccapi_cpp/service/ccapi_service.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,9 @@ class Service : public std::enable_shared_from_this<Service> {
531531
auto streamPtr = std::make_shared<T>(*iocPtr, *ctxPtr);
532532

533533
// Set SNI hostname (important for TLS handshakes)
534-
if (!SSL_set_tlsext_host_name(streamPtr->native_handle(), host.c_str())) {
534+
if (!CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name for host " + host + ": " + ec.message()); (streamPtr->native_handle(), host.c_str())) {
535535
beast::error_code ec{static_cast<int>(::ERR_get_error()), net::error::get_ssl_category()};
536-
CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name: " + ec.message());
536+
CCAPI_LOGGER_DEBUG("error CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name for host " + host + ": " + ec.message());: " + ec.message());
537537
throw ec;
538538
}
539539

@@ -1022,9 +1022,10 @@ class Service : public std::enable_shared_from_this<Service> {
10221022

10231023
if constexpr (std::is_same_v<StreamType, beast::websocket::stream<beast::ssl_stream<beast::tcp_stream>>>) {
10241024
// Set SNI hostname (only for WSS)
1025-
if (!SSL_set_tlsext_host_name(streamPtr->next_layer().native_handle(), wsConnectionPtr->host.c_str())) {
1025+
if (!CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name for host " + host + ": " + ec.message());
1026+
(streamPtr->next_layer().native_handle(), wsConnectionPtr->host.c_str())) {
10261027
beast::error_code ec{static_cast<int>(::ERR_get_error()), net::error::get_ssl_category()};
1027-
CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name: " + ec.message());
1028+
CCAPI_LOGGER_DEBUG("error CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name for host " + host + ": " + ec.message());: " + ec.message());
10281029
this->onError(Event::Type::SUBSCRIPTION_STATUS, Message::Type::SUBSCRIPTION_FAILURE, ec, "set SNI Hostname", wsConnectionPtr->correlationIdList);
10291030
return;
10301031
}

0 commit comments

Comments
 (0)