mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
rpcbind: Warn about exposing RPC to untrusted networks
This commit is contained in:
parent
d6a1287481
commit
27c44ef9c6
2 changed files with 5 additions and 1 deletions
|
|
@ -323,6 +323,10 @@ static bool HTTPBindAddresses(struct evhttp* http)
|
|||
LogPrint(BCLog::HTTP, "Binding RPC on address %s port %i\n", i->first, i->second);
|
||||
evhttp_bound_socket *bind_handle = evhttp_bind_socket_with_handle(http, i->first.empty() ? nullptr : i->first.c_str(), i->second);
|
||||
if (bind_handle) {
|
||||
CNetAddr addr;
|
||||
if (i->first.empty() || (LookupHost(i->first.c_str(), addr, false) && addr.IsBindAny())) {
|
||||
LogPrintf("WARNING: the RPC server is not safe to expose to untrusted networks such as the public internet\n");
|
||||
}
|
||||
boundSockets.push_back(bind_handle);
|
||||
} else {
|
||||
LogPrintf("Binding RPC on address %s port %i failed.\n", i->first, i->second);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue