Improve log message for connecting nodes without configured Endpoint object
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 21 Jul 2016 11:48:00 +0000 (13:48 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 21 Jul 2016 11:48:00 +0000 (13:48 +0200)
fixes #12194

lib/remote/apilistener.cpp

index 01c7d6db3560451620cd644638c17a64181d0093..843294d8ec02dc2daa7464ac3515d27b4f6cf4ee 100644 (file)
@@ -354,12 +354,19 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
                        }
                }
 
-               Log(LogInformation, "ApiListener")
-                   << "New client connection for identity '" << identity << "'"
-                   << (verify_ok ? "" : " (client certificate not signed by CA)");
-
                if (verify_ok)
                        endpoint = Endpoint::GetByName(identity);
+
+               {
+                       Log log(LogInformation, "ApiListener");
+
+                       log << "New client connection for identity '" << identity << "'";
+
+                       if (!verify_ok)
+                               log << " (client certificate not signed by CA)";
+                       else if (!endpoint)
+                               log << " (no Endpoint object found for identity)";
+               }
        } else {
                Log(LogInformation, "ApiListener")
                    << "New client connection (no client certificate)";