From ce7fcbb4aea884bb4bf433cf419ffa267f859c87 Mon Sep 17 00:00:00 2001 From: Lee Clagett Date: Sun, 5 Feb 2017 17:48:03 -0500 Subject: Add server auth to monerod, and client auth to wallet-cli and wallet-rpc --- src/daemon/rpc_command_executor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/daemon/rpc_command_executor.cpp') diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index f7d85b5ef..3ea160c55 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -29,6 +29,7 @@ // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers #include "string_tools.h" +#include "common/password.h" #include "common/scoped_message_writer.h" #include "daemon/rpc_command_executor.h" #include "rpc/core_rpc_server_commands_defs.h" @@ -95,7 +96,7 @@ namespace { t_rpc_command_executor::t_rpc_command_executor( uint32_t ip , uint16_t port - , const std::string &user_agent + , const boost::optional& login , bool is_rpc , cryptonote::core_rpc_server* rpc_server ) @@ -103,7 +104,10 @@ t_rpc_command_executor::t_rpc_command_executor( { if (is_rpc) { - m_rpc_client = new tools::t_rpc_client(ip, port); + boost::optional http_login{}; + if (login) + http_login.emplace(login->username, login->password.password()); + m_rpc_client = new tools::t_rpc_client(ip, port, std::move(http_login)); } else { -- cgit v1.2.3