Skip to content

Commit

Permalink
Back to simple DNS name URL for HTTPS
Browse files Browse the repository at this point in the history
We're not sure why this is necessary yet

Co-authored-by: Simon Lo <[email protected]>
  • Loading branch information
garethsb and lo-simon committed Feb 23, 2024
1 parent 7480e93 commit 0ab8dec
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Development/nmos/mdns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0ab8dec

Please sign in to comment.