You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/01/27 05:13:49 UTC
[GitHub] [geode] pivotal-jbarrett opened a new pull request #7315: GEODE-9991: Configure SSLParameters directly.
pivotal-jbarrett opened a new pull request #7315:
URL: https://github.com/apache/geode/pull/7315
<!-- Thank you for submitting a contribution to Apache Geode. -->
<!-- In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
-->
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
- [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
- [ ] Is your initial contribution a single, squashed commit?
- [ ] Does `gradlew build` run cleanly?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
<!-- Note:
Please ensure that once the PR is submitted, check Concourse for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett merged pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett merged pull request #7315:
URL: https://github.com/apache/geode/pull/7315
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r805073666
##########
File path: geode-core/src/main/java/org/apache/geode/internal/net/SSLConfig.java
##########
@@ -67,26 +73,30 @@
@Immutable
private final SSLParameterExtension sslParameterExtension;
- private SSLConfig(boolean endpointIdentification,
- boolean useDefaultSSLContext,
- boolean enabled,
- String protocols,
- String ciphers,
- boolean requireAuth,
- String keystore,
- String keystoreType,
- String keystorePassword,
- String truststore,
- String truststorePassword,
- String truststoreType,
- String alias,
- SecurableCommunicationChannel securableCommunicationChannel,
- Properties properties,
- SSLParameterExtension sslParameterExtension) {
+ private SSLConfig(final boolean endpointIdentification,
+ final boolean useDefaultSSLContext,
+ final boolean enabled,
+ final @NotNull String protocols,
+ final @Nullable String clientProtocols,
+ final @Nullable String serverProtocols,
+ final String ciphers,
+ final boolean requireAuth,
+ final String keystore,
+ final String keystoreType,
+ final String keystorePassword,
+ final String truststore,
+ final String truststorePassword,
+ final String truststoreType,
+ final String alias,
+ final SecurableCommunicationChannel securableCommunicationChannel,
+ final Properties properties,
+ final SSLParameterExtension sslParameterExtension) {
this.endpointIdentification = endpointIdentification;
this.useDefaultSSLContext = useDefaultSSLContext;
this.enabled = enabled;
this.protocols = protocols;
Review comment:
Good catch and question. I wasn't sure how it was used in that deprecated `toDSProperties` method, which is only used by the mostly deprecated JMX admin stuff in `RemoteTransportConfig`. I sort of drew a line in the sand that I wasn't going to go there. I could either mark the property as `@Deprecated` for removal when that old admin stuff is removed, or propagate the `ssl-client-protocols` value there instead. Thoughts?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] metatype commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
metatype commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r793638891
##########
File path: geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
##########
@@ -362,38 +362,36 @@ public SSLEngine createSSLEngine(String hostName, int port, boolean clientSocket
}
@VisibleForTesting
- void configureSSLEngine(SSLEngine engine, String hostName, int port, boolean clientSocket) {
- SSLParameters parameters = engine.getSSLParameters();
- boolean updateEngineWithParameters = false;
+ void configureSSLEngine(final SSLEngine engine, final String hostName, final int port,
+ final boolean clientSocket) {
+ engine.setUseClientMode(clientSocket);
+ final SSLParameters parameters = engine.getSSLParameters();
+ configureSSLParameters(parameters, hostName, port, clientSocket);
+ engine.setSSLParameters(parameters);
Review comment:
Do you see any reason for the previous code trying to avoid invoking `engine.setSSLParameters` when nothing has changed? (the `updateEngineWithParameters` flag)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] kirklund commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
kirklund commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r804917579
##########
File path: geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java
##########
@@ -39,8 +39,11 @@
import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLING_ENABLED;
import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPort;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
Review comment:
I think `org.assertj.core.api.Assertions.assertThat` should be used for these instead of mixing two assertion libraries.
You can also easily replace `org.junit.Assert.fail` with `org.assertj.core.api.Assertions.fail` just by swapping the import. Then that just leaves `org.junit.Assert.assertEquals` if you want to replace it with AssertJ.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r793661535
##########
File path: geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
##########
@@ -362,38 +362,36 @@ public SSLEngine createSSLEngine(String hostName, int port, boolean clientSocket
}
@VisibleForTesting
- void configureSSLEngine(SSLEngine engine, String hostName, int port, boolean clientSocket) {
- SSLParameters parameters = engine.getSSLParameters();
- boolean updateEngineWithParameters = false;
+ void configureSSLEngine(final SSLEngine engine, final String hostName, final int port,
+ final boolean clientSocket) {
+ engine.setUseClientMode(clientSocket);
+ final SSLParameters parameters = engine.getSSLParameters();
+ configureSSLParameters(parameters, hostName, port, clientSocket);
+ engine.setSSLParameters(parameters);
Review comment:
I couldn't find any good reason. I think It was an attempt to avoid the issues reported in [GEODE-8419](https://issues.apache.org/jira/browse/GEODE-8419). But looking at the sources setting all these parameters via the `SSLParameters` is the safest approach. Alternatively we could get and set the SSLParameters around each parameter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] upthewaterspout commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
upthewaterspout commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r805065991
##########
File path: geode-core/src/main/java/org/apache/geode/internal/net/SSLConfig.java
##########
@@ -67,26 +73,30 @@
@Immutable
private final SSLParameterExtension sslParameterExtension;
- private SSLConfig(boolean endpointIdentification,
- boolean useDefaultSSLContext,
- boolean enabled,
- String protocols,
- String ciphers,
- boolean requireAuth,
- String keystore,
- String keystoreType,
- String keystorePassword,
- String truststore,
- String truststorePassword,
- String truststoreType,
- String alias,
- SecurableCommunicationChannel securableCommunicationChannel,
- Properties properties,
- SSLParameterExtension sslParameterExtension) {
+ private SSLConfig(final boolean endpointIdentification,
+ final boolean useDefaultSSLContext,
+ final boolean enabled,
+ final @NotNull String protocols,
+ final @Nullable String clientProtocols,
+ final @Nullable String serverProtocols,
+ final String ciphers,
+ final boolean requireAuth,
+ final String keystore,
+ final String keystoreType,
+ final String keystorePassword,
+ final String truststore,
+ final String truststorePassword,
+ final String truststoreType,
+ final String alias,
+ final SecurableCommunicationChannel securableCommunicationChannel,
+ final Properties properties,
+ final SSLParameterExtension sslParameterExtension) {
this.endpointIdentification = endpointIdentification;
this.useDefaultSSLContext = useDefaultSSLContext;
this.enabled = enabled;
this.protocols = protocols;
Review comment:
Do we still need this protocols field, now that we have server and client protocols?
##########
File path: geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
##########
@@ -2154,6 +2155,29 @@
* <U>Since</U>: Geode 1.0
*/
String SSL_PROTOCOLS = "ssl-protocols";
+
+ /**
+ * The static String definition of the <i>"ssl-client-protocols"</i> property <a
+ * name="ssl-client-protocols"/a>
+ * </p>
+ * <U>Description</U>: A space separated list of the SSL protocols to enable on the client side
+ * of the SSL connection. Those listed must be supported by the available providers.
+ * </p>
+ * <U>Default</U>: "any"
+ */
+ String SSL_CLIENT_PROTOCOLS = "ssl-client-protocols";
+
+ /**
+ * The static String definition of the <i>"ssl-server-protocols"</i> property <a
+ * name="ssl-server-protocols"/a>
+ * </p>
+ * <U>Description</U>: A space separated list of the SSL protocols to enable on the server side
+ * of the SSL connection. Those listed must be supported by the available providers.
+ * </p>
+ * <U>Default</U>: "any"
+ */
+ String SSL_SERVER_PROTOCOLS = "ssl-server-protocols";
Review comment:
These new properties need more documentation about how they relate and which geode processes they apply to. For example, does ssl-server-protocols really default to "any" or does it default to the value of ssl-protocols? What happens if I sent all of these.
##########
File path: geode-core/src/upgradeTest/java/org/apache/geode/internal/net/SocketCreatorUpgradeTest.java
##########
@@ -0,0 +1,429 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.internal.net;
+
+import static java.lang.Integer.parseInt;
+import static java.lang.String.format;
+import static java.lang.System.getenv;
+import static java.nio.charset.Charset.defaultCharset;
+import static org.apache.commons.io.FileUtils.readFileToString;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_CLIENT_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENABLED_COMPONENTS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENDPOINT_IDENTIFICATION_ENABLED;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_TYPE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_SERVER_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_TYPE;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import org.apache.geode.cache.ssl.CertStores;
+import org.apache.geode.cache.ssl.CertificateBuilder;
+import org.apache.geode.cache.ssl.CertificateMaterial;
+import org.apache.geode.internal.UniquePortSupplier;
+import org.apache.geode.internal.shared.NativeCalls;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+import org.apache.geode.test.junit.rules.gfsh.GfshScript;
+import org.apache.geode.test.version.TestVersion;
+import org.apache.geode.test.version.VersionManager;
+
+@RunWith(Parameterized.class)
+public class SocketCreatorUpgradeTest {
+ public static final String ALGORITHM = "SHA256withRSA";
+ public static final int EXPIRATION = 1;
+ public static final String STORE_PASSWORD = "geode";
+ public static final String STORE_TYPE = "jks";
+ public static final String PROTOCOL_TLSv1_2 = "TLSv1.2";
+ public static final String PROTOCOL_TLSv1_2_SSLv2Hello = "TLSv1.2,SSLv2Hello";
+ public static final String PROTOCOL_ANY = "any";
+ public static final String LOCATOR_1 = "locator1";
+ public static final String LOCATOR_2 = "locator2";
+
+ private final String startLocator1;
+ private final String startLocator2;
+ private final String startLocator1New;
+ private final String startLocator2New;
+ private final String stopLocator1;
+ private final String stopLocator2;
+
+ @Rule
+ public TemporaryFolder tempFolder = new TemporaryFolder();
+
+ @Rule
+ public final GfshRule gfshOldGeodeOldJava;
+
+ @Rule
+ public final GfshRule gfshOldGeodeNewJava;
+
+ @Rule
+ public final GfshRule gfshNewGeodeOldJava;
+
+ @Rule
+ public final GfshRule gfshNewGeodeNewJava;
+
+ private final File root;
+ private final File keyStoreFile;
+ private final File trustStoreFile;
+ private final File securityPropertiesFile;
+ private final File newSecurityPropertiesFile;
+
+ @Parameters(name = "{0}")
+ public static Collection<String> data() {
+ final List<String> result = VersionManager.getInstance().getVersionsWithoutCurrent();
+ result.removeIf(s -> TestVersion.compare(s, "1.13.0") < 0);
Review comment:
Did you mean to not test upgrades from older versions of Geode?
##########
File path: geode-core/src/upgradeTest/java/org/apache/geode/internal/net/SocketCreatorUpgradeTest.java
##########
@@ -0,0 +1,429 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.internal.net;
+
+import static java.lang.Integer.parseInt;
+import static java.lang.String.format;
+import static java.lang.System.getenv;
+import static java.nio.charset.Charset.defaultCharset;
+import static org.apache.commons.io.FileUtils.readFileToString;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_CLIENT_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENABLED_COMPONENTS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENDPOINT_IDENTIFICATION_ENABLED;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_TYPE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_SERVER_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_TYPE;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import org.apache.geode.cache.ssl.CertStores;
+import org.apache.geode.cache.ssl.CertificateBuilder;
+import org.apache.geode.cache.ssl.CertificateMaterial;
+import org.apache.geode.internal.UniquePortSupplier;
+import org.apache.geode.internal.shared.NativeCalls;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+import org.apache.geode.test.junit.rules.gfsh.GfshScript;
+import org.apache.geode.test.version.TestVersion;
+import org.apache.geode.test.version.VersionManager;
+
+@RunWith(Parameterized.class)
+public class SocketCreatorUpgradeTest {
Review comment:
Is this the right name for this test? Seems like this is maybe an upgrade with TLS enabled test, or some such?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on pull request #7315:
URL: https://github.com/apache/geode/pull/7315#issuecomment-1036596511
In case anyone was wondering, I ran this new upgrade test with alternative JDKs on Windows manually and it works. Woot!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on pull request #7315:
URL: https://github.com/apache/geode/pull/7315#issuecomment-1036626487
> you can also add the `windows` label to this PR to have CI run checks on Windows too on the next commit
I didn't think we had a Windows upgrade test job.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r794214764
##########
File path: geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
##########
@@ -362,38 +362,36 @@ public SSLEngine createSSLEngine(String hostName, int port, boolean clientSocket
}
@VisibleForTesting
- void configureSSLEngine(SSLEngine engine, String hostName, int port, boolean clientSocket) {
- SSLParameters parameters = engine.getSSLParameters();
- boolean updateEngineWithParameters = false;
+ void configureSSLEngine(final SSLEngine engine, final String hostName, final int port,
+ final boolean clientSocket) {
+ engine.setUseClientMode(clientSocket);
+ final SSLParameters parameters = engine.getSSLParameters();
+ configureSSLParameters(parameters, hostName, port, clientSocket);
+ engine.setSSLParameters(parameters);
Review comment:
`SSLParameters` is basically a POJO for holding properties of the `SSLEngine`. If you look at the `SSLEngine::getSSLParameters` it just constructs a new object with values from the `SSLEngine`. If you look at the `SSLEngine::setSSLParameters` it sets the values back on the `SSLEngine`. The issue in the original codes was the interleaving of values set on `SSLParameters` and `SSLEngine` between the `getSSLParameters` and `setSSLParameters`, effectively wiping out all the direct `SSLEngine` settings.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] Bill commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
Bill commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r793912047
##########
File path: geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
##########
@@ -362,38 +362,36 @@ public SSLEngine createSSLEngine(String hostName, int port, boolean clientSocket
}
@VisibleForTesting
- void configureSSLEngine(SSLEngine engine, String hostName, int port, boolean clientSocket) {
- SSLParameters parameters = engine.getSSLParameters();
- boolean updateEngineWithParameters = false;
+ void configureSSLEngine(final SSLEngine engine, final String hostName, final int port,
+ final boolean clientSocket) {
+ engine.setUseClientMode(clientSocket);
+ final SSLParameters parameters = engine.getSSLParameters();
+ configureSSLParameters(parameters, hostName, port, clientSocket);
+ engine.setSSLParameters(parameters);
Review comment:
I've reviewed the [PR for GEODE-8419](https://github.com/apache/geode/pull/5465) and it looks like the idea in both this method and in `configureClientSSLSocket()` was to set parameters at most once, and to avoid setting them at all if they didn't need to be modified.
I wondered if setting them more aggressively e.g. unconditionally, had some untoward effect but I don't see that sort of issue when inspecting the code.
If setting everything via `SSLParameters` instead of a combination of `SSLParameters` and direct setter calls on the engine will work then it'll be a nice improvement. Our testing should answer that question.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on pull request #7315:
URL: https://github.com/apache/geode/pull/7315#issuecomment-1023269775
The stress test failures are from a test that is really an integration test. I will move `SocketCreatorJUnitTest::testBindExceptionMessageFormattingWithBindAddress` to integration tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] kirklund commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
kirklund commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r804917579
##########
File path: geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java
##########
@@ -39,8 +39,11 @@
import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLING_ENABLED;
import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPort;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
Review comment:
Approved but I think `org.assertj.core.api.Assertions.assertThat` should be used for these instead of mixing two assertion libraries.
You can also easily replace `org.junit.Assert.fail` with `org.assertj.core.api.Assertions.fail` just by swapping the import. Then that just leaves `org.junit.Assert.assertEquals` if you want to replace it with AssertJ.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r805123383
##########
File path: geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java
##########
@@ -39,8 +39,11 @@
import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLING_ENABLED;
import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPort;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
Review comment:
Check it out now! Updated to JUnit 5, uses annotations for System Properties, use assertj, and merge duplicate test files into one. Feels so much cleaner.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r805079529
##########
File path: geode-core/src/upgradeTest/java/org/apache/geode/internal/net/SocketCreatorUpgradeTest.java
##########
@@ -0,0 +1,429 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.internal.net;
+
+import static java.lang.Integer.parseInt;
+import static java.lang.String.format;
+import static java.lang.System.getenv;
+import static java.nio.charset.Charset.defaultCharset;
+import static org.apache.commons.io.FileUtils.readFileToString;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_CLIENT_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENABLED_COMPONENTS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENDPOINT_IDENTIFICATION_ENABLED;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_TYPE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_SERVER_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_TYPE;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import org.apache.geode.cache.ssl.CertStores;
+import org.apache.geode.cache.ssl.CertificateBuilder;
+import org.apache.geode.cache.ssl.CertificateMaterial;
+import org.apache.geode.internal.UniquePortSupplier;
+import org.apache.geode.internal.shared.NativeCalls;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+import org.apache.geode.test.junit.rules.gfsh.GfshScript;
+import org.apache.geode.test.version.TestVersion;
+import org.apache.geode.test.version.VersionManager;
+
+@RunWith(Parameterized.class)
+public class SocketCreatorUpgradeTest {
+ public static final String ALGORITHM = "SHA256withRSA";
+ public static final int EXPIRATION = 1;
+ public static final String STORE_PASSWORD = "geode";
+ public static final String STORE_TYPE = "jks";
+ public static final String PROTOCOL_TLSv1_2 = "TLSv1.2";
+ public static final String PROTOCOL_TLSv1_2_SSLv2Hello = "TLSv1.2,SSLv2Hello";
+ public static final String PROTOCOL_ANY = "any";
+ public static final String LOCATOR_1 = "locator1";
+ public static final String LOCATOR_2 = "locator2";
+
+ private final String startLocator1;
+ private final String startLocator2;
+ private final String startLocator1New;
+ private final String startLocator2New;
+ private final String stopLocator1;
+ private final String stopLocator2;
+
+ @Rule
+ public TemporaryFolder tempFolder = new TemporaryFolder();
+
+ @Rule
+ public final GfshRule gfshOldGeodeOldJava;
+
+ @Rule
+ public final GfshRule gfshOldGeodeNewJava;
+
+ @Rule
+ public final GfshRule gfshNewGeodeOldJava;
+
+ @Rule
+ public final GfshRule gfshNewGeodeNewJava;
+
+ private final File root;
+ private final File keyStoreFile;
+ private final File trustStoreFile;
+ private final File securityPropertiesFile;
+ private final File newSecurityPropertiesFile;
+
+ @Parameters(name = "{0}")
+ public static Collection<String> data() {
+ final List<String> result = VersionManager.getInstance().getVersionsWithoutCurrent();
+ result.removeIf(s -> TestVersion.compare(s, "1.13.0") < 0);
Review comment:
Not planning on a path for 1.11 and older.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on pull request #7315:
URL: https://github.com/apache/geode/pull/7315#issuecomment-1023559757
> mockito dependency changes look good.
I am enabling the inline mocking feature that allows Mockito to mock final classes and methods. It only had a noticeable side effect on one test, which is fixed here. It was necessary to test some of the methods in the SSLParameters because for some reason some methods are final.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] onichols-pivotal edited a comment on pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
onichols-pivotal edited a comment on pull request #7315:
URL: https://github.com/apache/geode/pull/7315#issuecomment-1036614296
> In case anyone was wondering, I ran this new upgrade test with alternative JDKs on Windows manually and it works. Woot!
you could also add the `windows` label to this PR to have CI run checks on Windows too on the next commit ... iff these tests fall into a category that we cover on Windows
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r805071856
##########
File path: geode-core/src/upgradeTest/java/org/apache/geode/internal/net/SocketCreatorUpgradeTest.java
##########
@@ -0,0 +1,429 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.internal.net;
+
+import static java.lang.Integer.parseInt;
+import static java.lang.String.format;
+import static java.lang.System.getenv;
+import static java.nio.charset.Charset.defaultCharset;
+import static org.apache.commons.io.FileUtils.readFileToString;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_CLIENT_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENABLED_COMPONENTS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENDPOINT_IDENTIFICATION_ENABLED;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_TYPE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_SERVER_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_TYPE;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import org.apache.geode.cache.ssl.CertStores;
+import org.apache.geode.cache.ssl.CertificateBuilder;
+import org.apache.geode.cache.ssl.CertificateMaterial;
+import org.apache.geode.internal.UniquePortSupplier;
+import org.apache.geode.internal.shared.NativeCalls;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+import org.apache.geode.test.junit.rules.gfsh.GfshScript;
+import org.apache.geode.test.version.TestVersion;
+import org.apache.geode.test.version.VersionManager;
+
+@RunWith(Parameterized.class)
+public class SocketCreatorUpgradeTest {
+ public static final String ALGORITHM = "SHA256withRSA";
+ public static final int EXPIRATION = 1;
+ public static final String STORE_PASSWORD = "geode";
+ public static final String STORE_TYPE = "jks";
+ public static final String PROTOCOL_TLSv1_2 = "TLSv1.2";
+ public static final String PROTOCOL_TLSv1_2_SSLv2Hello = "TLSv1.2,SSLv2Hello";
+ public static final String PROTOCOL_ANY = "any";
+ public static final String LOCATOR_1 = "locator1";
+ public static final String LOCATOR_2 = "locator2";
+
+ private final String startLocator1;
+ private final String startLocator2;
+ private final String startLocator1New;
+ private final String startLocator2New;
+ private final String stopLocator1;
+ private final String stopLocator2;
+
+ @Rule
+ public TemporaryFolder tempFolder = new TemporaryFolder();
+
+ @Rule
+ public final GfshRule gfshOldGeodeOldJava;
+
+ @Rule
+ public final GfshRule gfshOldGeodeNewJava;
+
+ @Rule
+ public final GfshRule gfshNewGeodeOldJava;
+
+ @Rule
+ public final GfshRule gfshNewGeodeNewJava;
+
+ private final File root;
+ private final File keyStoreFile;
+ private final File trustStoreFile;
+ private final File securityPropertiesFile;
+ private final File newSecurityPropertiesFile;
+
+ @Parameters(name = "{0}")
+ public static Collection<String> data() {
+ final List<String> result = VersionManager.getInstance().getVersionsWithoutCurrent();
+ result.removeIf(s -> TestVersion.compare(s, "1.13.0") < 0);
Review comment:
Yes, I am currently working on migration path from 1.12. The 1.13 and 1.4 paths aren't compatibly with 1.12.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r804926883
##########
File path: geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java
##########
@@ -39,8 +39,11 @@
import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLING_ENABLED;
import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPort;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
Review comment:
Good call! I have to fix some other tests so I will do this in my next push!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r805123143
##########
File path: geode-core/src/upgradeTest/java/org/apache/geode/internal/net/SocketCreatorUpgradeTest.java
##########
@@ -0,0 +1,429 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.internal.net;
+
+import static java.lang.Integer.parseInt;
+import static java.lang.String.format;
+import static java.lang.System.getenv;
+import static java.nio.charset.Charset.defaultCharset;
+import static org.apache.commons.io.FileUtils.readFileToString;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_CLIENT_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENABLED_COMPONENTS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENDPOINT_IDENTIFICATION_ENABLED;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_TYPE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_SERVER_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_TYPE;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import org.apache.geode.cache.ssl.CertStores;
+import org.apache.geode.cache.ssl.CertificateBuilder;
+import org.apache.geode.cache.ssl.CertificateMaterial;
+import org.apache.geode.internal.UniquePortSupplier;
+import org.apache.geode.internal.shared.NativeCalls;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+import org.apache.geode.test.junit.rules.gfsh.GfshScript;
+import org.apache.geode.test.version.TestVersion;
+import org.apache.geode.test.version.VersionManager;
+
+@RunWith(Parameterized.class)
+public class SocketCreatorUpgradeTest {
+ public static final String ALGORITHM = "SHA256withRSA";
+ public static final int EXPIRATION = 1;
+ public static final String STORE_PASSWORD = "geode";
+ public static final String STORE_TYPE = "jks";
+ public static final String PROTOCOL_TLSv1_2 = "TLSv1.2";
+ public static final String PROTOCOL_TLSv1_2_SSLv2Hello = "TLSv1.2,SSLv2Hello";
+ public static final String PROTOCOL_ANY = "any";
+ public static final String LOCATOR_1 = "locator1";
+ public static final String LOCATOR_2 = "locator2";
+
+ private final String startLocator1;
+ private final String startLocator2;
+ private final String startLocator1New;
+ private final String startLocator2New;
+ private final String stopLocator1;
+ private final String stopLocator2;
+
+ @Rule
+ public TemporaryFolder tempFolder = new TemporaryFolder();
+
+ @Rule
+ public final GfshRule gfshOldGeodeOldJava;
+
+ @Rule
+ public final GfshRule gfshOldGeodeNewJava;
+
+ @Rule
+ public final GfshRule gfshNewGeodeOldJava;
+
+ @Rule
+ public final GfshRule gfshNewGeodeNewJava;
+
+ private final File root;
+ private final File keyStoreFile;
+ private final File trustStoreFile;
+ private final File securityPropertiesFile;
+ private final File newSecurityPropertiesFile;
+
+ @Parameters(name = "{0}")
+ public static Collection<String> data() {
+ final List<String> result = VersionManager.getInstance().getVersionsWithoutCurrent();
+ result.removeIf(s -> TestVersion.compare(s, "1.13.0") < 0);
Review comment:
Test has been updated to support 1.12.1 and newer. 1.12.0 is too broken.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on pull request #7315:
URL: https://github.com/apache/geode/pull/7315#issuecomment-1027262785
@upthewaterspout
> I do think maybe some integration/acceptance testing is needed here. IE if I start a GemFire peer or server is it actually using the ssl protocols that a user has configured? Seems like that was not happening before.
Writing tests at this level would require either log scraping or punching dirty holes through the interfaces to get to the `SSLEngine` objects. I have written an integration tests that tests the `SocketCreator.createSSLEngine()` that asserts the `SSLEngine` is configured as expected. I believe these should be sufficient integration coverage for any code path that uses this method to construct its `SSLEngine`, any path that does something else isn't affected by this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r805072461
##########
File path: geode-core/src/upgradeTest/java/org/apache/geode/internal/net/SocketCreatorUpgradeTest.java
##########
@@ -0,0 +1,429 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.internal.net;
+
+import static java.lang.Integer.parseInt;
+import static java.lang.String.format;
+import static java.lang.System.getenv;
+import static java.nio.charset.Charset.defaultCharset;
+import static org.apache.commons.io.FileUtils.readFileToString;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_CLIENT_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENABLED_COMPONENTS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENDPOINT_IDENTIFICATION_ENABLED;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_TYPE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_REQUIRE_AUTHENTICATION;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_SERVER_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_TYPE;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import org.apache.geode.cache.ssl.CertStores;
+import org.apache.geode.cache.ssl.CertificateBuilder;
+import org.apache.geode.cache.ssl.CertificateMaterial;
+import org.apache.geode.internal.UniquePortSupplier;
+import org.apache.geode.internal.shared.NativeCalls;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+import org.apache.geode.test.junit.rules.gfsh.GfshScript;
+import org.apache.geode.test.version.TestVersion;
+import org.apache.geode.test.version.VersionManager;
+
+@RunWith(Parameterized.class)
+public class SocketCreatorUpgradeTest {
Review comment:
It could be. That is the problem with system level upgrade tests, how do you name them and what package. In this case I chose the name of the thing I was directly changing to fix this bug. The test them implies to me, "does SocketCreator do the right thing on upgrades?"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] onichols-pivotal commented on pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
onichols-pivotal commented on pull request #7315:
URL: https://github.com/apache/geode/pull/7315#issuecomment-1036614296
> In case anyone was wondering, I ran this new upgrade test with alternative JDKs on Windows manually and it works. Woot!
you can also add the `windows` label to this PR to have CI run checks on Windows too on the next commit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] pivotal-jbarrett commented on a change in pull request #7315: GEODE-9991: Configure SSLParameters directly.
Posted by GitBox <gi...@apache.org>.
pivotal-jbarrett commented on a change in pull request #7315:
URL: https://github.com/apache/geode/pull/7315#discussion_r805073879
##########
File path: geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
##########
@@ -2154,6 +2155,29 @@
* <U>Since</U>: Geode 1.0
*/
String SSL_PROTOCOLS = "ssl-protocols";
+
+ /**
+ * The static String definition of the <i>"ssl-client-protocols"</i> property <a
+ * name="ssl-client-protocols"/a>
+ * </p>
+ * <U>Description</U>: A space separated list of the SSL protocols to enable on the client side
+ * of the SSL connection. Those listed must be supported by the available providers.
+ * </p>
+ * <U>Default</U>: "any"
+ */
+ String SSL_CLIENT_PROTOCOLS = "ssl-client-protocols";
+
+ /**
+ * The static String definition of the <i>"ssl-server-protocols"</i> property <a
+ * name="ssl-server-protocols"/a>
+ * </p>
+ * <U>Description</U>: A space separated list of the SSL protocols to enable on the server side
+ * of the SSL connection. Those listed must be supported by the available providers.
+ * </p>
+ * <U>Default</U>: "any"
+ */
+ String SSL_SERVER_PROTOCOLS = "ssl-server-protocols";
Review comment:
I think I have the documented in one place but not here. Good eye!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org