Skip to content

Commit

Permalink
update client & server to plumb verify mode option internally
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Apr 26, 2024
1 parent a112e5b commit 6c5113b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions libs/client-sdk/src/data_sources/polling_data_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ PollingDataSource::PollingDataSource(
status_manager_(status_manager),
data_source_handler_(
DataSourceEventHandler(context, handler, logger, status_manager_)),
requester_(ioc,
http_properties.Tls().VerifyPeer() ? ssl::verify_peer
: ssl::verify_none),
requester_(ioc, http_properties.Tls().VerifyMode()),
timer_(ioc),
polling_interval_(
std::get<
Expand All @@ -90,7 +88,8 @@ PollingDataSource::PollingDataSource(
auto const& polling_config = std::get<
config::shared::built::PollingConfig<config::shared::ClientSDK>>(
data_source_config.method);
if (!http_properties.Tls().VerifyPeer()) {
if (http_properties.Tls().VerifyMode() ==
config::shared::built::TlsOptions::VerifyMode::kVerifyNone) {
LD_LOG(logger_, LogLevel::kDebug) << "SSL peer verification disabled";
}
if (polling_interval_ < polling_config.min_polling_interval) {
Expand Down
4 changes: 3 additions & 1 deletion libs/client-sdk/src/data_sources/streaming_data_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ void StreamingDataSource::Start() {
client_builder.header(header.first, header.second);
}

client_builder.verify_peer(http_config_.Tls().VerifyPeer());
client_builder.verify_peer(
http_config_.Tls().VerifyMode() ==
config::shared::built::TlsOptions::VerifyMode::kVerifyPeer);

auto weak_self = weak_from_this();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ PollingDataSource::PollingDataSource(
config::built::HttpProperties const& http_properties)
: logger_(logger),
status_manager_(status_manager),
requester_(ioc),
requester_(ioc, http_properties.Tls().VerifyMode()),
polling_interval_(data_source_config.poll_interval),
request_(MakeRequest(data_source_config, endpoints, http_properties)),
timer_(ioc),
Expand Down

0 comments on commit 6c5113b

Please sign in to comment.