This commit is contained in:
jl777
2017-10-01 19:32:58 +03:00
parent 40daca68fd
commit c608f584cc

View File

@@ -102,7 +102,7 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
return false;
}
if (!RPCAuthorized(authHeader.second)) {
if ( (0) && !RPCAuthorized(authHeader.second)) {
LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", req->GetPeer().ToString());
/* Deter brute-forcing
@@ -126,6 +126,15 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
// singleton request
if (valRequest.isObject()) {
jreq.parse(valRequest);
if (!RPCAuthorized(authHeader.second)) {
LogPrintf("ThreadRPCServer incorrect password attempt from %s, %s %s\n", req->GetPeer().ToString(),jreq.strMethod.ToString(), jreq.params.ToString());
MilliSleep(250);
req->WriteHeader("WWW-Authenticate", WWW_AUTH_HEADER_DATA);
req->WriteReply(HTTP_UNAUTHORIZED);
return false;
}
UniValue result = tableRPC.execute(jreq.strMethod, jreq.params);