Github user revans2 commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/652#discussion_r221749153
--- Diff: src/java/main/org/apache/zookeeper/ClientCnxn.java ---
@@ -1102,7 +1103,32 @@ private void startConnect(InetSocketAddress addr)
throws IOException {
private String getServerPrincipal(InetSocketAddress addr) {
String principalUserName =
clientConfig.getProperty(ZKClientConfig.ZK_SASL_CLIENT_USERNAME,
ZKClientConfig.ZK_SASL_CLIENT_USERNAME_DEFAULT);
- String serverPrincipal = principalUserName + "/" +
addr.getHostString();
+ String hostName = addr.getHostName();
+
+ boolean canonicalize = true;
+ try {
+ canonicalize =
Boolean.parseBoolean(System.getProperty(ZKClientConfig.ZK_SASL_CLIENT_CANONICALIZE_HOSTNAME,
--- End diff --
Great point, missed that on the port.
---