Skip to content

Commit ea0ab8b

Browse files
committed
make error log for SSL_set_tlsext_host_name clearer
1 parent a52c755 commit ea0ab8b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/ccapi_cpp/service/ccapi_fix_service.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class FixService : public Service {
170170
if constexpr (std::is_same_v<StreamType, beast::ssl_stream<beast::tcp_stream>>) {
171171
if (!SSL_set_tlsext_host_name(streamPtr->native_handle(), fixConnectionPtr->host.c_str())) {
172172
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());
173+
CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name for host " + fixConnectionPtr->host + ": " + ec.message());
174174
this->onError(Event::Type::FIX_STATUS, Message::Type::FIX_FAILURE, ec, "set SNI Hostname", {fixConnectionPtr->subscription.getCorrelationId()});
175175
return;
176176
}

include/ccapi_cpp/service/ccapi_service.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ class Service : public std::enable_shared_from_this<Service> {
533533
// Set SNI hostname (important for TLS handshakes)
534534
if (!SSL_set_tlsext_host_name(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 SSL_set_tlsext_host_name for host " + host + ": " + ec.message());
537537
throw ec;
538538
}
539539

@@ -1024,7 +1024,7 @@ class Service : public std::enable_shared_from_this<Service> {
10241024
// Set SNI hostname (only for WSS)
10251025
if (!SSL_set_tlsext_host_name(streamPtr->next_layer().native_handle(), wsConnectionPtr->host.c_str())) {
10261026
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());
1027+
CCAPI_LOGGER_DEBUG("error SSL_set_tlsext_host_name for host " + wsConnectionPtr->host + ": " + ec.message());
10281028
this->onError(Event::Type::SUBSCRIPTION_STATUS, Message::Type::SUBSCRIPTION_FAILURE, ec, "set SNI Hostname", wsConnectionPtr->correlationIdList);
10291029
return;
10301030
}

0 commit comments

Comments
 (0)