You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bb...@apache.org on 2022/02/09 20:14:09 UTC

[geode-native] branch develop updated: GEODE-9959: Add FQDN in log upon SSL missconfig (#904)

This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new 8659e22  GEODE-9959: Add FQDN in log upon SSL missconfig (#904)
8659e22 is described below

commit 8659e22805479bb6d3927cdf903dfcb71b4fa2b2
Author: Mario Salazar de Torres <ma...@est.tech>
AuthorDate: Wed Feb 9 21:13:01 2022 +0100

    GEODE-9959: Add FQDN in log upon SSL missconfig (#904)
    
    - Whenever there is an SSL missoconfiguration while trying to reach a
       locator, an AuthenticationRequiredException is thrown and a log is
       written. Currently FQDN of the locator is not logged.
     - This commit adds the locator FQDN in order to further troubleshoot
       this kind of scenarios.
     - Also, in order to ease implementation, toString method was
       implemented for ServerLocation.
---
 cppcache/src/ServerLocation.hpp          | 4 ++++
 cppcache/src/ThinClientLocatorHelper.cpp | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/cppcache/src/ServerLocation.hpp b/cppcache/src/ServerLocation.hpp
index 36863e0..fac42f9 100644
--- a/cppcache/src/ServerLocation.hpp
+++ b/cppcache/src/ServerLocation.hpp
@@ -82,6 +82,10 @@ class ServerLocation : public internal::DataSerializableInternal {
     return size;
   }
 
+  std::string toString() const override {
+    return m_serverName + ":" + std::to_string(m_port);
+  }
+
   void printInfo() {
     LOGDEBUG(" Got Host \"%s\", and port %d", getServerName().c_str(), m_port);
   }
diff --git a/cppcache/src/ThinClientLocatorHelper.cpp b/cppcache/src/ThinClientLocatorHelper.cpp
index 1a3a568..7d97443 100644
--- a/cppcache/src/ThinClientLocatorHelper.cpp
+++ b/cppcache/src/ThinClientLocatorHelper.cpp
@@ -145,7 +145,8 @@ std::shared_ptr<Serializable> ThinClientLocatorHelper::sendRequest(
         reinterpret_cast<uint8_t*>(buff), receivedLength);
 
     if (di.read() == REPLY_SSL_ENABLED && !sys_prop.sslEnabled()) {
-      LOGERROR("SSL is enabled on locator, enable SSL in client as well");
+      LOGERROR("SSL is enabled on locator %s, enable SSL in client as well",
+               location.toString().c_str());
       throw AuthenticationRequiredException(
           "SSL is enabled on locator, enable SSL in client as well");
     }