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();