changeset 707:4b7885be4cb0 draft

rpc: don't send 403 when using SSL to prevent DoS Signed-off-by: Giel van Schijndel <me@mortis.eu>
author Giel van Schijndel <me@mortis.eu>
date Sat, 25 Jun 2011 04:31:48 +0200
parents 65d3b325c5eb
children 52761243416e
files src/rpc.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/rpc.cpp
+++ b/src/rpc.cpp
@@ -1889,7 +1889,9 @@
         // Restrict callers by IP
         if (!ClientAllowed(peer.address().to_string()))
         {
-            stream << HTTPReply(403, "") << std::flush;
+            // 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;
             continue;
         }