SOLR-12988: Disable SSL on Java 11/12 for now.

This commit is contained in:
markrmiller 2018-12-09 14:45:35 -06:00
parent 0aef561245
commit 3eb2612e67
6 changed files with 19 additions and 2 deletions

View File

@ -87,6 +87,7 @@ public final class Constants {
public static final boolean JRE_IS_MINIMUM_JAVA8 = JVM_MAJOR_VERSION > 1 || (JVM_MAJOR_VERSION == 1 && JVM_MINOR_VERSION >= 8);
public static final boolean JRE_IS_MINIMUM_JAVA9 = JVM_MAJOR_VERSION > 1 || (JVM_MAJOR_VERSION == 1 && JVM_MINOR_VERSION >= 9);
public static final boolean JRE_IS_MINIMUM_JAVA11 = JVM_MAJOR_VERSION > 1 || (JVM_MAJOR_VERSION == 1 && JVM_MINOR_VERSION >= 11);
/**
* This is the internal Lucene version, including bugfix versions, recorded into each segment.

View File

@ -16,6 +16,7 @@
*/
package org.apache.solr.client.solrj.embedded;
import org.apache.lucene.util.Constants;
import org.eclipse.jetty.util.ssl.SslContextFactory;
/**
@ -34,7 +35,13 @@ public class SSLConfig {
/** NOTE: all other settings are ignored if useSSL is false; trustStore settings are ignored if clientAuth is false */
public SSLConfig(boolean useSSL, boolean clientAuth, String keyStore, String keyStorePassword, String trustStore, String trustStorePassword) {
this.useSsl = useSSL;
// @AwaitsFix: SOLR-12988 - ssl issues on Java 11/12
if (Constants.JRE_IS_MINIMUM_JAVA11) {
this.useSsl = false;
} else {
this.useSsl = useSSL;
}
this.clientAuth = clientAuth;
this.keyStore = keyStore;
this.keyStorePassword = keyStorePassword;

View File

@ -85,6 +85,8 @@ public class TestMiniSolrCloudClusterSSL extends SolrTestCaseJ4 {
@Before
public void before() {
assumeFalse("@AwaitsFix: SOLR-12988 - ssl issues on Java 11/12", Constants.JRE_IS_MINIMUM_JAVA11);
// undo the randomization of our super class
log.info("NOTE: This Test ignores the randomized SSL & clientAuth settings selected by base class");
HttpClientUtil.resetHttpClientBuilder(); // also resets SchemaRegistryProvider

View File

@ -19,6 +19,7 @@ package org.apache.solr.cloud;
import java.lang.invoke.MethodHandles;
import java.util.Arrays;
import org.apache.lucene.util.Constants;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.util.SSLTestConfig;
import org.apache.solr.util.RandomizeSSL;
@ -43,6 +44,7 @@ public class TestSSLRandomization extends SolrCloudTestCase {
@BeforeClass
public static void createMiniSolrCloudCluster() throws Exception {
assumeFalse("@AwaitsFix: SOLR-12988 - ssl issues on Java 11/12", Constants.JRE_IS_MINIMUM_JAVA11);
configureCluster(TestMiniSolrCloudClusterSSL.NUM_SERVERS).configure();
}

View File

@ -20,14 +20,18 @@ package org.apache.solr.client.solrj.impl;
import java.net.URL;
import java.util.Arrays;
import org.apache.lucene.util.Constants;
import org.apache.solr.util.RandomizeSSL;
import org.junit.BeforeClass;
@RandomizeSSL(1.0)
public class HttpSolrClientSSLAuthConPoolTest extends HttpSolrClientConPoolTest {
@BeforeClass
public static void checkUrls() throws Exception {
assumeFalse("@AwaitsFix: SOLR-12988 - ssl issues on Java 11/12", Constants.JRE_IS_MINIMUM_JAVA11);
URL[] urls = new URL[] {
jetty.getBaseUrl(), yetty.getBaseUrl()
};

View File

@ -98,8 +98,9 @@ public class SSLTestConfig extends SSLConfig {
*/
public SSLTestConfig(boolean useSSL, boolean clientAuth, boolean checkPeerName) {
super(useSSL, clientAuth, null, TEST_KEYSTORE_PASSWORD, null, TEST_KEYSTORE_PASSWORD);
this.checkPeerName = checkPeerName;
final String resourceName = checkPeerName
? TEST_KEYSTORE_LOCALHOST_RESOURCE : TEST_KEYSTORE_BOGUSHOST_RESOURCE;
trustStore = keyStore = Resource.newClassPathResource(resourceName);