[16/18] incubator-geode git commit: GEODE-1834: initilize the socketcreator with the correct ssl settings
GEODE-1834: initilize the socketcreator with the correct ssl settings Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/a4c38a46 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/a4c38a46 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/a4c38a46 Branch: refs/heads/feature/GEODE-420 Commit: a4c38a469d0726c8fd59f444e342d3d062c47004 Parents: bb829d3 Author: Jinmei LiaoAuthored: Thu Sep 1 09:27:11 2016 -0700 Committer: Jinmei Liao Committed: Tue Sep 6 08:27:45 2016 -0700 -- .../internal/JmxManagerLocatorRequest.java | 8 +- .../internal/cli/commands/ShellCommands.java| 21 ++- .../ConnectToLocatorSSLDUnitTest.java | 136 +++ 3 files changed, 150 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a4c38a46/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java index 861f51d..ac250d0 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java @@ -25,6 +25,7 @@ import java.util.Properties; import com.gemstone.gemfire.distributed.internal.tcpserver.TcpClient; import com.gemstone.gemfire.internal.DataSerializableFixedID; +import com.gemstone.gemfire.internal.SocketCreator; import com.gemstone.gemfire.internal.Version; /** @@ -80,13 +81,14 @@ public class JmxManagerLocatorRequest implements DataSerializableFixedID { InetAddress networkAddress = InetAddress.getByName(locatorHost); try { - // Changes for 46623 - // initialize the SocketCreator with props which may contain SSL config - // empty distConfProps will reset SocketCreator if (sslConfigProps != null) { distributionConfigProps.putAll(sslConfigProps); } + // re-initialize the SocketCreator with the sslConfigProps. Note this initializes the SocketCreator with cluster-ssl-* settings since + // we are connecting to the locator only. + SocketCreator.getDefaultInstance(distributionConfigProps); + Object responseFromServer = TcpClient.requestToServer(networkAddress, locatorPort, SINGLETON, msTimeout); return (JmxManagerLocatorResponse) responseFromServer; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a4c38a46/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java index 09a25a6..daa7262 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java @@ -17,6 +17,8 @@ package com.gemstone.gemfire.management.internal.cli.commands; +import static com.gemstone.gemfire.distributed.ConfigurationProperties.*; + import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; @@ -38,11 +40,18 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; + import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; +import org.springframework.shell.core.CommandMarker; +import org.springframework.shell.core.ExitShellRequest; +import org.springframework.shell.core.annotation.CliAvailabilityIndicator; +import org.springframework.shell.core.annotation.CliCommand; +import org.springframework.shell.core.annotation.CliOption; + import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.ClassPathLoader; import com.gemstone.gemfire.internal.DSFIDFactory; @@ -79,14 +88,6 @@ import com.gemstone.gemfire.management.internal.web.shell.HttpOperationInvoker; import com.gemstone.gemfire.management.internal.web.shell.RestHttpOperationInvoker; import com.gemstone.gemfire.security.AuthenticationFailedException; -import org.springframework.shell.core.CommandMarker; -import org.springframework.shell.core.ExitShellRequest; -import
incubator-geode git commit: GEODE-1834: initilize the socketcreator with the correct ssl settings
Repository: incubator-geode Updated Branches: refs/heads/develop bb829d3dc -> a4c38a469 GEODE-1834: initilize the socketcreator with the correct ssl settings Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/a4c38a46 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/a4c38a46 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/a4c38a46 Branch: refs/heads/develop Commit: a4c38a469d0726c8fd59f444e342d3d062c47004 Parents: bb829d3 Author: Jinmei LiaoAuthored: Thu Sep 1 09:27:11 2016 -0700 Committer: Jinmei Liao Committed: Tue Sep 6 08:27:45 2016 -0700 -- .../internal/JmxManagerLocatorRequest.java | 8 +- .../internal/cli/commands/ShellCommands.java| 21 ++- .../ConnectToLocatorSSLDUnitTest.java | 136 +++ 3 files changed, 150 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a4c38a46/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java index 861f51d..ac250d0 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java @@ -25,6 +25,7 @@ import java.util.Properties; import com.gemstone.gemfire.distributed.internal.tcpserver.TcpClient; import com.gemstone.gemfire.internal.DataSerializableFixedID; +import com.gemstone.gemfire.internal.SocketCreator; import com.gemstone.gemfire.internal.Version; /** @@ -80,13 +81,14 @@ public class JmxManagerLocatorRequest implements DataSerializableFixedID { InetAddress networkAddress = InetAddress.getByName(locatorHost); try { - // Changes for 46623 - // initialize the SocketCreator with props which may contain SSL config - // empty distConfProps will reset SocketCreator if (sslConfigProps != null) { distributionConfigProps.putAll(sslConfigProps); } + // re-initialize the SocketCreator with the sslConfigProps. Note this initializes the SocketCreator with cluster-ssl-* settings since + // we are connecting to the locator only. + SocketCreator.getDefaultInstance(distributionConfigProps); + Object responseFromServer = TcpClient.requestToServer(networkAddress, locatorPort, SINGLETON, msTimeout); return (JmxManagerLocatorResponse) responseFromServer; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a4c38a46/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java index 09a25a6..daa7262 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java @@ -17,6 +17,8 @@ package com.gemstone.gemfire.management.internal.cli.commands; +import static com.gemstone.gemfire.distributed.ConfigurationProperties.*; + import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; @@ -38,11 +40,18 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; + import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; +import org.springframework.shell.core.CommandMarker; +import org.springframework.shell.core.ExitShellRequest; +import org.springframework.shell.core.annotation.CliAvailabilityIndicator; +import org.springframework.shell.core.annotation.CliCommand; +import org.springframework.shell.core.annotation.CliOption; + import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.ClassPathLoader; import com.gemstone.gemfire.internal.DSFIDFactory; @@ -79,14 +88,6 @@ import com.gemstone.gemfire.management.internal.web.shell.HttpOperationInvoker; import com.gemstone.gemfire.management.internal.web.shell.RestHttpOperationInvoker; import com.gemstone.gemfire.security.AuthenticationFailedException; -import org.springframework.shell.core.CommandMarker;