From 0ab8deccf523015eca4e29c7637775cbc347a3fd Mon Sep 17 00:00:00 2001 From: Gareth Sylvester-Bradley Date: Fri, 23 Feb 2024 10:29:26 +0000 Subject: [PATCH] Back to simple DNS name URL for HTTPS We're not sure why this is necessary yet Co-authored-by: Simon Lo --- Development/nmos/mdns.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Development/nmos/mdns.cpp b/Development/nmos/mdns.cpp index 2549e5f4..a900570f 100644 --- a/Development/nmos/mdns.cpp +++ b/Development/nmos/mdns.cpp @@ -559,16 +559,26 @@ namespace nmos // remove a trailing '.' to turn an FQDN into a DNS name, for SSL certificate matching if (!host_name.empty() && U('.') == host_name.back()) host_name.pop_back(); - for (const auto& ip_address : resolved.ip_addresses) + if (is_service_protocol_secure(resolved_proto)) { - // sneakily stash the host name for the Host header in user info - // cf. nmos::details::make_http_client results->push_back({ { *resolved_ver, resolved_pri }, resolved_uri - .set_user_info(host_name) - .set_host(utility::s2us(ip_address)) + .set_host(host_name) .to_uri() }); } + else + { + for (const auto& ip_address : resolved.ip_addresses) + { + // sneakily stash the host name for the Host header in user info + // cf. nmos::details::make_http_client + results->push_back({ { *resolved_ver, resolved_pri }, resolved_uri + .set_user_info(host_name) + .set_host(utility::s2us(ip_address)) + .to_uri() + }); + } + } return true; }, resolving.name, resolving.type, resolving.domain, resolving.interface_id, timeout - std::chrono::steady_clock::now(), token).wait();