|
16 | 16 | */ |
17 | 17 | package org.apache.solr.util; |
18 | 18 |
|
19 | | -import com.carrotsearch.randomizedtesting.RandomizedTest; |
20 | 19 | import java.security.KeyManagementException; |
21 | 20 | import java.security.KeyStore; |
22 | 21 | import java.security.KeyStoreException; |
|
27 | 26 | import java.security.UnrecoverableKeyException; |
28 | 27 | import java.util.Random; |
29 | 28 | import java.util.concurrent.ThreadLocalRandom; |
30 | | -import java.util.regex.Pattern; |
31 | 29 | import javax.net.ssl.SSLContext; |
32 | 30 | import org.apache.http.config.Registry; |
33 | 31 | import org.apache.http.config.RegistryBuilder; |
|
38 | 36 | import org.apache.http.conn.ssl.TrustSelfSignedStrategy; |
39 | 37 | import org.apache.http.ssl.SSLContextBuilder; |
40 | 38 | import org.apache.http.ssl.SSLContexts; |
41 | | -import org.apache.lucene.util.Constants; |
42 | 39 | import org.apache.solr.client.solrj.embedded.SSLConfig; |
43 | 40 | import org.apache.solr.client.solrj.impl.HttpClientUtil; |
44 | 41 | import org.apache.solr.client.solrj.impl.HttpClientUtil.SocketFactoryRegistryProvider; |
@@ -108,10 +105,6 @@ public SSLTestConfig(boolean useSsl, boolean clientAuth, boolean checkPeerName) |
108 | 105 | this.clientAuth = clientAuth; |
109 | 106 | this.checkPeerName = checkPeerName; |
110 | 107 |
|
111 | | - if (this.useSsl) { |
112 | | - assumeSslIsSafeToTest(); |
113 | | - } |
114 | | - |
115 | 108 | final String resourceName = |
116 | 109 | checkPeerName ? TEST_KEYSTORE_LOCALHOST_RESOURCE : TEST_KEYSTORE_BOGUSHOST_RESOURCE; |
117 | 110 | trustStore = keyStore = Resource.newClassPathResource(resourceName); |
@@ -414,50 +407,4 @@ public void reseed(SecureRandomParameters params) { |
414 | 407 | /* NOOP */ |
415 | 408 | } |
416 | 409 | } |
417 | | - |
418 | | - /** |
419 | | - * Helper method for sanity checking if it's safe to use SSL on this JVM |
420 | | - * |
421 | | - * @see <a href="https://issues.apache.org/jira/browse/SOLR-12988">SOLR-12988</a> |
422 | | - * @throws org.junit.internal.AssumptionViolatedException if this JVM is known to have SSL |
423 | | - * problems |
424 | | - */ |
425 | | - public static void assumeSslIsSafeToTest() { |
426 | | - if (Constants.JVM_NAME.startsWith("OpenJDK") |
427 | | - || Constants.JVM_NAME.startsWith("Java HotSpot(TM)")) { |
428 | | - RandomizedTest.assumeFalse( |
429 | | - "Test (or randomization for this seed) wants to use SSL, " |
430 | | - + "but SSL is known to fail on your JVM: " |
431 | | - + Constants.JVM_NAME |
432 | | - + " / " |
433 | | - + Constants.JVM_VERSION, |
434 | | - isOpenJdkJvmVersionKnownToHaveProblems(Constants.JVM_VERSION)); |
435 | | - } |
436 | | - } |
437 | | - |
438 | | - /** |
439 | | - * package visibility for tests |
440 | | - * |
441 | | - * @see Constants#JVM_VERSION |
442 | | - * @lucene.internal |
443 | | - */ |
444 | | - static boolean isOpenJdkJvmVersionKnownToHaveProblems(final String jvmVersion) { |
445 | | - // TODO: would be nice to replace with Runtime.Version once we don't have to |
446 | | - // worry about java8 support when backporting to branch_8x |
447 | | - return KNOWN_BAD_OPENJDK_JVMS.matcher(jvmVersion).matches(); |
448 | | - } |
449 | | - |
450 | | - private static final Pattern KNOWN_BAD_OPENJDK_JVMS = |
451 | | - Pattern.compile( // 11 to 11.0.2 were all definitely problematic |
452 | | - // - https://bugs.openjdk.java.net/browse/JDK-8212885 |
453 | | - // - https://bugs.openjdk.java.net/browse/JDK-8213202 |
454 | | - "(^11(\\.0(\\.0|\\.1|\\.2)?)?($|(\\_|\\+|\\-).*$))|" |
455 | | - + |
456 | | - // early (pre-ea) "testing" builds of 11, 12, and 13 were also buggy |
457 | | - // - https://bugs.openjdk.java.net/browse/JDK-8224829 |
458 | | - "(^(11|12|13).*-testing.*$)|" |
459 | | - + |
460 | | - // So far, all 13-ea builds (up to 13-ea-26) have been buggy |
461 | | - // - https://bugs.openjdk.java.net/browse/JDK-8226338 |
462 | | - "(^13-ea.*$)"); |
463 | 410 | } |
0 commit comments