diff --git a/x-pack/plugin/security/cli/src/test/java/org/elasticsearch/xpack/security/cli/CertificateGenerateToolTests.java b/x-pack/plugin/security/cli/src/test/java/org/elasticsearch/xpack/security/cli/CertificateGenerateToolTests.java index 25d7f1629d133..647b8957fa5ee 100644 --- a/x-pack/plugin/security/cli/src/test/java/org/elasticsearch/xpack/security/cli/CertificateGenerateToolTests.java +++ b/x-pack/plugin/security/cli/src/test/java/org/elasticsearch/xpack/security/cli/CertificateGenerateToolTests.java @@ -7,13 +7,11 @@ import com.google.common.jimfs.Configuration; import com.google.common.jimfs.Jimfs; -import org.bouncycastle.asn1.DLTaggedObject; -import org.elasticsearch.bootstrap.JavaVersion; -import org.elasticsearch.core.internal.io.IOUtils; import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.ASN1String; import org.bouncycastle.asn1.DEROctetString; +import org.bouncycastle.asn1.DLTaggedObject; import org.bouncycastle.asn1.pkcs.Attribute; import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; import org.bouncycastle.asn1.x509.Extension; @@ -30,10 +28,13 @@ import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.network.NetworkAddress; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.SecuritySettingsSourceField; +import org.elasticsearch.xpack.core.ssl.CertParsingUtils; +import org.elasticsearch.xpack.core.ssl.PemUtils; import org.elasticsearch.xpack.security.cli.CertificateGenerateTool.CAInfo; import org.elasticsearch.xpack.security.cli.CertificateGenerateTool.CertificateInformation; import org.elasticsearch.xpack.security.cli.CertificateGenerateTool.Name; @@ -43,8 +44,6 @@ import org.junit.After; import org.junit.BeforeClass; -import javax.security.auth.x500.X500Principal; - import java.io.IOException; import java.io.InputStream; import java.io.Reader; @@ -74,6 +73,7 @@ import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; +import javax.security.auth.x500.X500Principal; import static org.elasticsearch.test.TestMatchers.pathExists; import static org.hamcrest.Matchers.containsString; @@ -265,7 +265,8 @@ public void testGeneratingCsr() throws Exception { public void testGeneratingSignedCertificates() throws Exception { assumeFalse("JDK bug JDK-8266279, https://github.com/elastic/elasticsearch/issues/72639", - JavaVersion.current().compareTo(JavaVersion.parse("8")) == 0); + "1.8.0_292".equals(System.getProperty("java.version"))); + Path tempDir = initTempDir(); Path outputFile = tempDir.resolve("out.zip"); Path instanceFile = writeInstancesTo(tempDir.resolve("instances.yml")); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/saml/SamlRealmTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/saml/SamlRealmTests.java index 7b461e2d590d6..4bf5a9eee8404 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/saml/SamlRealmTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/saml/SamlRealmTests.java @@ -34,6 +34,7 @@ import org.elasticsearch.xpack.security.authc.support.UserRoleMapper; import org.hamcrest.Matchers; import org.junit.Before; +import org.junit.BeforeClass; import org.mockito.Mockito; import org.opensaml.saml.common.xml.SAMLConstants; import org.opensaml.saml.metadata.resolver.impl.AbstractReloadingMetadataResolver; @@ -105,6 +106,12 @@ public void setupEnv() throws PrivilegedActionException { threadContext = new ThreadContext(globalSettings); } + @BeforeClass + public static void muteOnBrokenJdk() { + assumeFalse("JDK bug JDK-8266279, https://github.com/elastic/elasticsearch/issues/75571", + "1.8.0_292".equals(System.getProperty("java.version"))); + } + public void testReadIdpMetadataFromFile() throws Exception { final Path path = getDataPath("idp1.xml"); Tuple config = buildConfig(path.toString());