Warn if control is enabled with non-local bind address (#2401)
This commit is contained in:
parent
cd9deef4b3
commit
9b30b399b3
1 changed files with 6 additions and 0 deletions
|
|
@ -29,6 +29,12 @@ nano::rpc::~rpc ()
|
||||||
void nano::rpc::start ()
|
void nano::rpc::start ()
|
||||||
{
|
{
|
||||||
auto endpoint (boost::asio::ip::tcp::endpoint (config.address, config.port));
|
auto endpoint (boost::asio::ip::tcp::endpoint (config.address, config.port));
|
||||||
|
if (!endpoint.address ().is_loopback () && config.enable_control)
|
||||||
|
{
|
||||||
|
auto warning = boost::str (boost::format ("WARNING: control-level RPCs are enabled on non-local address %1%, potentially allowing wallet access outside local computer") % endpoint.address ().to_string ());
|
||||||
|
std::cout << warning << std::endl;
|
||||||
|
logger.always_log (warning);
|
||||||
|
}
|
||||||
acceptor.open (endpoint.protocol ());
|
acceptor.open (endpoint.protocol ());
|
||||||
acceptor.set_option (boost::asio::ip::tcp::acceptor::reuse_address (true));
|
acceptor.set_option (boost::asio::ip::tcp::acceptor::reuse_address (true));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue