rpc: don't send 403 when using SSL to prevent DoS

Signed-off-by: Giel van Schijndel <me@mortis.eu>
This commit is contained in:
Giel van Schijndel 2011-06-25 04:31:48 +02:00
parent c9e70d4c0a
commit e913574e02

View File

@ -1889,6 +1889,8 @@ void ThreadRPCServer2(void* parg)
// Restrict callers by IP // Restrict callers by IP
if (!ClientAllowed(peer.address().to_string())) if (!ClientAllowed(peer.address().to_string()))
{ {
// Only send a 403 if we're not using SSL to prevent a DoS during the SSL handshake.
if (!fUseSSL)
stream << HTTPReply(403, "") << std::flush; stream << HTTPReply(403, "") << std::flush;
continue; continue;
} }