microsoft/scitt-ccf-ledger

Don't hardcode `localhost` in `did:web` resolver as callback address

letmaik opened this issue · 0 comments

auto [_host, port] =
ccf::split_net_address(primary_interface.bind_address);
return fmt::format("https://localhost:{}/did/{}/doc", port, did);

If a node is configured to bind to 0.0.0.0 then using localhost works. But if it binds to a concrete IP address that's not 0.0.0.0, then localhost doesn't work.

The code should be changed to just use the binding address as callback address as-is. Note that this works even with 0.0.0.0 (which is mostly a Linux feature).