diff --git a/changes.md b/changes.md index 39abccdf89..c1ab002a6b 100644 --- a/changes.md +++ b/changes.md @@ -3,6 +3,7 @@ Changes log - 2.7.1 (??-??-2026) - Bugs fixed + - `DefaultSslContextFactory` now uses the JVM default algorithms for the trust manager (`TrustManagerFactory.getDefaultAlgorithm()`, `PKIX`) and the key manager (`KeyManagerFactory.getDefaultAlgorithm()`) instead of the obsolete `SunX509`, unless the `ssl.TrustManagerFactory.algorithm` or `ssl.KeyManagerFactory.algorithm` system property, the `trustManagerAlgorithm` or `keyManagerAlgorithm` parameter, or the setters say otherwise. A valid certificate chain that is not in order is no longer rejected with a "Certificate chaining error". The `PKIX` validation is the standard one, and stricter than `SunX509` on unusual chains: set the trust manager algorithm to `SunX509` to get the previous behavior. Issue #1397. - `Redirector.getTargetRef()` now removes the dot segments (`.` and `..`) of the target URI (RFC 3986, section 5.2.4), so the `Location` header of a client redirection and the URI of a server redirection are normalized. Relative-path targets such as `../x` are left untouched, as they need their base reference. A reverse proxy built on `http://backend/root/{rr}` now resolves a `..` found in the remaining part itself, which it did not before the request reached the backend. Issue #238. - The Jackson, Gson and JSON (org.json) converters now handle the `application/*+json` media types, such as `application/vnd.example+json`. They were ignored, so an incoming `+json` entity was not converted, and a `+json` response was left to another converter (such as JAXB) when it scored higher than the 0.5 given by Jackson. A custom converter that won for these media types may now lose to the JSON converters. Issue #1185. - Misc diff --git a/org.restlet/src/main/java/org/restlet/engine/ssl/DefaultSslContextFactory.java b/org.restlet/src/main/java/org/restlet/engine/ssl/DefaultSslContextFactory.java index a3bc2cd66b..468a72965d 100644 --- a/org.restlet/src/main/java/org/restlet/engine/ssl/DefaultSslContextFactory.java +++ b/org.restlet/src/main/java/org/restlet/engine/ssl/DefaultSslContextFactory.java @@ -67,7 +67,7 @@ * * keyManagerAlgorithm * String - * System property "ssl.KeyManagerFactory.algorithm" or "SunX509" + * System property "ssl.KeyManagerFactory.algorithm" or the JVM default algorithm * Certificate algorithm for the key manager. * * @@ -116,7 +116,7 @@ * * trustManagerAlgorithm * String - * System property "ssl.TrustManagerFactory.algorithm" or "SunX509" + * System property "ssl.TrustManagerFactory.algorithm" or the JVM default algorithm * Certificate algorithm for the trust manager. * * @@ -184,11 +184,11 @@ public class DefaultSslContextFactory extends SslContextFactory { /** The whitespace-separated list of enabled SSL protocols. */ private volatile String[] enabledProtocols = null; - private static final String SUN_X509 = "SunX509"; - /** The name of the KeyManager algorithm. */ private volatile String keyManagerAlgorithm = - System.getProperty("ssl.KeyManagerFactory.algorithm", SUN_X509); + System.getProperty( + "ssl.KeyManagerFactory.algorithm", + javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm()); /** The password for the key in the keystore (as a String). */ private volatile char[] keyStoreKeyPassword = @@ -240,7 +240,9 @@ private static String getDefaultKeyStorePath() { /** The name of the TrustManager algorithm. */ private volatile String trustManagerAlgorithm = - System.getProperty("ssl.TrustManagerFactory.algorithm", SUN_X509); + System.getProperty( + "ssl.TrustManagerFactory.algorithm", + javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm()); /** The password for the trust store keystore. */ private volatile char[] trustStorePassword = @@ -638,7 +640,9 @@ public void init(Series helperParameters) { helperParameters.getFirstValue( "keyManagerAlgorithm", true, - System.getProperty("ssl.KeyManagerFactory.algorithm", SUN_X509))); + System.getProperty( + "ssl.KeyManagerFactory.algorithm", + javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm()))); setKeyStorePassword( helperParameters.getFirstValue( "keyStorePassword", @@ -667,7 +671,9 @@ public void init(Series helperParameters) { helperParameters.getFirstValue( "trustManagerAlgorithm", true, - System.getProperty("ssl.TrustManagerFactory.algorithm", SUN_X509))); + System.getProperty( + "ssl.TrustManagerFactory.algorithm", + javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm()))); setTrustStorePassword( helperParameters.getFirstValue( "trustStorePassword", @@ -769,8 +775,9 @@ public void setEnabledProtocols(String[] enabledProtocols) { /** * Sets the KeyManager algorithm. The default value is that of the - * ssl.KeyManagerFactory.algorithm system property, or "SunX509" if the system - * property has not been set up. + * ssl.KeyManagerFactory.algorithm system property, or the JVM default algorithm (see + * {@link javax.net.ssl.KeyManagerFactory#getDefaultAlgorithm()}) if the system property has not + * been set up. * * @param keyManagerAlgorithm The KeyManager algorithm. */ @@ -881,8 +888,11 @@ public void setSecureRandomAlgorithm(String secureRandomAlgorithm) { /** * Sets the TrustManager algorithm. The default value is that of the - * ssl.TrustManagerFactory.algorithm system property, or "SunX509" if the system - * property has not been set up. + * ssl.TrustManagerFactory.algorithm system property, or the JVM default algorithm (see + * {@link javax.net.ssl.TrustManagerFactory#getDefaultAlgorithm()}, "PKIX" unless the + * ssl.TrustManagerFactory.algorithm security property says otherwise) if the system + * property has not been set up. The "SunX509" algorithm is obsolete: it fails on a valid + * certificate chain that is not in order. * * @param trustManagerAlgorithm The TrustManager algorithm. */ diff --git a/org.restlet/src/test/java/org/restlet/engine/ssl/DefaultSslContextFactoryTestCase.java b/org.restlet/src/test/java/org/restlet/engine/ssl/DefaultSslContextFactoryTestCase.java new file mode 100644 index 0000000000..52c82fd435 --- /dev/null +++ b/org.restlet/src/test/java/org/restlet/engine/ssl/DefaultSslContextFactoryTestCase.java @@ -0,0 +1,283 @@ +/** + * Copyright 2005-2026 Qlik + *

+ * The content of this file is subject to the terms of the Apache 2.0 open + * source license available at https://www.opensource.org/licenses/apache-2.0 + *

+ * Restlet is a registered trademark of QlikTech International AB. + */ +package org.restlet.engine.ssl; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.KeyFactory; +import java.security.KeyStore; +import java.security.PrivateKey; +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.security.spec.PKCS8EncodedKeySpec; +import java.util.Base64; +import java.util.concurrent.atomic.AtomicReference; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.TrustManagerFactory; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.restlet.data.Form; + +/** Unit tests for the default algorithms of {@link DefaultSslContextFactory} (#1397). */ +class DefaultSslContextFactoryTestCase { + + private static final String TRUST_PROPERTY = "ssl.TrustManagerFactory.algorithm"; + + private static final String KEY_PROPERTY = "ssl.KeyManagerFactory.algorithm"; + + private static final char[] PASSWORD = "changeit".toCharArray(); + + private String savedTrustProperty; + + private String savedKeyProperty; + + @TempDir Path tempDir; + + @BeforeEach + void clearAlgorithmProperties() { + savedTrustProperty = System.getProperty(TRUST_PROPERTY); + savedKeyProperty = System.getProperty(KEY_PROPERTY); + System.clearProperty(TRUST_PROPERTY); + System.clearProperty(KEY_PROPERTY); + } + + @AfterEach + void restoreAlgorithmProperties() { + restore(TRUST_PROPERTY, savedTrustProperty); + restore(KEY_PROPERTY, savedKeyProperty); + } + + private static void restore(String name, String value) { + if (value == null) { + System.clearProperty(name); + } else { + System.setProperty(name, value); + } + } + + // Defaults + + @Test + void trustManagerAlgorithm_defaultsToTheJvmDefault() { + assertEquals( + TrustManagerFactory.getDefaultAlgorithm(), + new DefaultSslContextFactory().getTrustManagerAlgorithm()); + } + + @Test + void keyManagerAlgorithm_defaultsToTheJvmDefault() { + assertEquals( + KeyManagerFactory.getDefaultAlgorithm(), + new DefaultSslContextFactory().getKeyManagerAlgorithm()); + } + + @Test + void algorithms_systemPropertiesOverrideTheJvmDefaults() { + System.setProperty(TRUST_PROPERTY, "SunX509"); + System.setProperty(KEY_PROPERTY, "NewSunX509"); + + DefaultSslContextFactory factory = new DefaultSslContextFactory(); + + assertEquals("SunX509", factory.getTrustManagerAlgorithm()); + assertEquals("NewSunX509", factory.getKeyManagerAlgorithm()); + } + + @Test + void algorithms_settersOverrideTheDefaults() { + DefaultSslContextFactory factory = new DefaultSslContextFactory(); + factory.setTrustManagerAlgorithm("SunX509"); + factory.setKeyManagerAlgorithm("NewSunX509"); + + assertEquals("SunX509", factory.getTrustManagerAlgorithm()); + assertEquals("NewSunX509", factory.getKeyManagerAlgorithm()); + } + + @Test + void init_withoutAlgorithmParameters_usesTheJvmDefaults() { + DefaultSslContextFactory factory = new DefaultSslContextFactory(); + factory.setTrustManagerAlgorithm("SunX509"); + factory.setKeyManagerAlgorithm("NewSunX509"); + + factory.init(new Form()); + + assertEquals(TrustManagerFactory.getDefaultAlgorithm(), factory.getTrustManagerAlgorithm()); + assertEquals(KeyManagerFactory.getDefaultAlgorithm(), factory.getKeyManagerAlgorithm()); + } + + @Test + void init_withAlgorithmParameters_usesTheParameters() { + Form parameters = new Form(); + parameters.add("trustManagerAlgorithm", "SunX509"); + parameters.add("keyManagerAlgorithm", "NewSunX509"); + DefaultSslContextFactory factory = new DefaultSslContextFactory(); + + factory.init(parameters); + + assertEquals("SunX509", factory.getTrustManagerAlgorithm()); + assertEquals("NewSunX509", factory.getKeyManagerAlgorithm()); + } + + // TLS handshakes: a valid chain served out of order (the symptom of #1397) + + @Test + void handshake_withChainInOrder_succeedsWithTheDefaultAlgorithms() throws Exception { + assertNull(handshake(chain("leaf", "intermediate"), null)); + } + + @Test + void handshake_withChainOutOfOrder_succeedsWithTheDefaultAlgorithms() throws Exception { + assertNull(handshake(chain("leaf", "root", "intermediate"), null)); + } + + @Test + void handshake_withChainOutOfOrder_failsWithSunX509() throws Exception { + // Documents the escape hatch: the old algorithm can still be selected, with its limits. + assertNotNull(handshake(chain("leaf", "root", "intermediate"), "SunX509")); + } + + @Test + void handshake_withChainInOrder_succeedsWithSunX509() throws Exception { + assertNull(handshake(chain("leaf", "intermediate"), "SunX509")); + } + + private Certificate[] chain(String... names) throws Exception { + Certificate[] result = new Certificate[names.length]; + for (int i = 0; i < names.length; i++) { + result[i] = certificate(names[i]); + } + return result; + } + + private Certificate certificate(String name) throws Exception { + try (InputStream in = resource("test-ca-" + name + ".pem")) { + return CertificateFactory.getInstance("X.509").generateCertificate(in); + } + } + + private PrivateKey leafKey() throws Exception { + try (InputStream in = resource("test-ca-leaf-key.pem")) { + String pem = + new String(in.readAllBytes(), java.nio.charset.StandardCharsets.US_ASCII) + .replaceAll("-----[A-Z ]+-----", "") + .replaceAll("\\s", ""); + return KeyFactory.getInstance("RSA") + .generatePrivate(new PKCS8EncodedKeySpec(Base64.getDecoder().decode(pem))); + } + } + + private InputStream resource(String name) throws IOException { + InputStream in = getClass().getResourceAsStream(name); + if (in == null) { + throw new IOException("Missing test resource " + name); + } + return in; + } + + /** + * Performs a TLS handshake over the loopback interface, both sides being built by {@link + * DefaultSslContextFactory}. The server serves the given chain from a JKS store (a PKCS12 store + * refuses a chain that is not in order), and the client trusts only the root certificate. + * + * @param serverChain The chain served by the server, leaf first. + * @param clientTrustAlgorithm The trust manager algorithm of the client, or null for the + * default. + * @return Null if the handshake succeeded, the description of the failure otherwise. + */ + private String handshake(Certificate[] serverChain, String clientTrustAlgorithm) + throws Exception { + Path keyStoreFile = tempDir.resolve("server.jks"); + KeyStore keyStore = KeyStore.getInstance("JKS"); + keyStore.load(null, null); + keyStore.setKeyEntry("server", leafKey(), PASSWORD, serverChain); + try (OutputStream out = Files.newOutputStream(keyStoreFile)) { + keyStore.store(out, PASSWORD); + } + + Path trustStoreFile = tempDir.resolve("trust.p12"); + KeyStore trustStore = KeyStore.getInstance("PKCS12"); + trustStore.load(null, null); + trustStore.setCertificateEntry("root", certificate("root")); + try (OutputStream out = Files.newOutputStream(trustStoreFile)) { + trustStore.store(out, PASSWORD); + } + + DefaultSslContextFactory serverFactory = new DefaultSslContextFactory(); + serverFactory.setKeyStorePath(keyStoreFile.toString()); + serverFactory.setKeyStoreType("JKS"); + serverFactory.setKeyStorePassword(PASSWORD); + serverFactory.setKeyStoreKeyPassword(PASSWORD); + + DefaultSslContextFactory clientFactory = new DefaultSslContextFactory(); + // The client has no key of its own: "NONE" avoids the default ~/.keystore. + clientFactory.setKeyStorePath("NONE"); + clientFactory.setKeyStorePassword(PASSWORD); + clientFactory.setKeyStoreKeyPassword(PASSWORD); + clientFactory.setTrustStorePath(trustStoreFile.toString()); + clientFactory.setTrustStoreType("PKCS12"); + clientFactory.setTrustStorePassword(PASSWORD); + if (clientTrustAlgorithm != null) { + clientFactory.setTrustManagerAlgorithm(clientTrustAlgorithm); + } + + AtomicReference serverFailure = new AtomicReference<>(); + try (SSLServerSocket serverSocket = + (SSLServerSocket) + serverFactory + .createSslContext() + .getServerSocketFactory() + .createServerSocket(0, 1, InetAddress.getLoopbackAddress())) { + serverSocket.setSoTimeout(10_000); + Thread server = + new Thread( + () -> { + try (SSLSocket socket = (SSLSocket) serverSocket.accept()) { + socket.setSoTimeout(10_000); + socket.startHandshake(); + socket.getOutputStream().write(1); + } catch (Exception e) { + serverFailure.set(e); + } + }); + server.start(); + + try (SSLSocket client = + (SSLSocket) + clientFactory + .createSslContext() + .getSocketFactory() + .createSocket( + InetAddress.getLoopbackAddress(), + serverSocket.getLocalPort())) { + client.setSoTimeout(10_000); + client.startHandshake(); + return null; + } catch (IOException e) { + Throwable root = e; + while (root.getCause() != null) { + root = root.getCause(); + } + return root.getClass().getSimpleName() + ": " + root.getMessage(); + } finally { + server.join(10_000); + } + } + } +} diff --git a/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-README.txt b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-README.txt new file mode 100644 index 0000000000..82cfa39f20 --- /dev/null +++ b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-README.txt @@ -0,0 +1,16 @@ +Test-only certificate chain for DefaultSslContextFactoryTestCase (#1397). + + test-ca-root.pem CN=Test Root CA (self-signed CA) + test-ca-intermediate.pem CN=Test Intermediate CA (CA, signed by the root) + test-ca-leaf.pem CN=localhost, SAN dns:localhost (signed by the intermediate) + test-ca-leaf-key.pem private key of the leaf, PKCS#8, TEST ONLY, protects nothing + +All certificates are valid for 36500 days from 2026-11-23 (RSA 2048). Generated with keytool: + + keytool -genkeypair -alias root -dname "CN=Test Root CA" -keyalg RSA -keysize 2048 -validity 36500 -ext bc:c ... + keytool -genkeypair -alias inter -dname "CN=Test Intermediate CA" ... -ext bc:c ... + keytool -genkeypair -alias leaf -dname "CN=localhost" ... -ext san=dns:localhost ... + keytool -certreq / keytool -gencert: intermediate signed by root, leaf signed by intermediate. + +The test serves the chain out of order ([leaf, root, intermediate]), which a PKCS12 key store refuses to +store, hence the JKS store built in memory by the test. diff --git a/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-intermediate.pem b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-intermediate.pem new file mode 100644 index 0000000000..fe4ac3115d --- /dev/null +++ b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-intermediate.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDDTCCAfWgAwIBAgIIfFfyKSrltcswDQYJKoZIhvcNAQEMBQAwFzEVMBMGA1UE +AxMMVGVzdCBSb290IENBMCAXDTI2MTEyMzE0NDIyN1oYDzIxMjYxMDMwMTQ0MjI3 +WjAfMR0wGwYDVQQDExRUZXN0IEludGVybWVkaWF0ZSBDQTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAKwKXOj0aDDoRxt1iA7cAHENsHiksu6S7SCd+p5t +vwkS1HASENbvgCVkkwPmuVDjaqMsfCQOJie71FB3okotqiAq0dNNzVYUb61d8WDX +7klPLFqOYX16o2FYrH2g0dMpXut8MFbx4HEoN69JqExID2CMW7z/S0sffijptU17 +LI5/7ABTftXVTUPDYbk3J0xEeQcHmFbRfotyaQpgkeeknkQxBUWsNHY6ymyZLNgO +uM6pcS0cqm4JgtWipZhjZxUIiP2FQMcXOnMiS6DwW6yuI7G/wptICPU8TFYyn3mn +lTWk7gpdTfgpo5SDU1t9Gd1HI6hfsBSiLGzll59bD6b4WB0CAwEAAaNTMFEwHQYD +VR0OBBYEFPN9rzRDZm7PthJ/UfqhFFLVY1eNMA8GA1UdEwEB/wQFMAMBAf8wHwYD +VR0jBBgwFoAU48gTRon0XxBVjW93XIabMqlhFXAwDQYJKoZIhvcNAQEMBQADggEB +AGMvnMOGc1SOUVaurxi7wz/Ze4xt57o0fP0Y4YWvm5+lHTkAMDOccc0afkgnNXAC +8hjjluF4xVRfISqnwu8EMnolwh84u8W1GJiTRZGPn7Jnr/IMEI4tqURqmBgCa19v +yIdIgewVy8bq2SGIh3P29NwNPihf/qXDfYG9H8reRq3NuJS6YtAnjk33h8xVi5EW +ScRhLrYyRcv9ZDPCXUnUPjIs6KvefLbJSFXAXo2sXX89Rv3viBKda5NvOMOisWz8 +2/RLemr/AKhBtZA68HHfN0Hg6HPEimzXMBqKAXTkiVj82kzRmJlf/bkosPbbeQTk +D4TP8nVQleHAUJs7K/H1HO0= +-----END CERTIFICATE----- diff --git a/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-leaf-key.pem b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-leaf-key.pem new file mode 100644 index 0000000000..4b2f5c6d50 --- /dev/null +++ b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-leaf-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC02WjHiaH8LdrD +hNSTYaRoxsvTRC1eT0HuOicMxdOTEOEso9heW4oBWliRf23P7aYUGtahLjfKz4QB +99IMB9NWjkeclVXNspjNlWv1t83dJmFIMiaDEEk/eUdiC1scvcC41qC8JnNasqru +EFaKSQoXDTQBZSVIqXkQpsIx27wTeVlo9kc8rzbIcxfewmDiX457y+f3nqG7Z2uz +I9b09Y9EiWXP0bcR5hfWcwE3OjVozy6nkOmcsBIpgvqZvqi/WfqQSpQVbSCVDIzi +ovtT0FENIPQDNOgWh+4sM30JS0cp48Z1P6G0OYfeOc5upPH35pybTVl6Rwb5C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GAX6GY0slYcPN6vth9f/XL +kwGCNvtFjYgSyiPFnf+WFn++D+pl2gze4yB8WO1A4K2d0Z7d0kYiafPdPuJn86et +Jr2W+7eK4BxHp3F6m/ZFVaQpvc9wf8yay+172xxRnpFmG7BcyT8eEthv/yDH0x1a +5T03kV/Q06Ld03scDc5nphE= +-----END PRIVATE KEY----- diff --git a/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-leaf.pem b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-leaf.pem new file mode 100644 index 0000000000..92d80ff29a --- /dev/null +++ b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-leaf.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDDzCCAfegAwIBAgIIKQsZmmxqQJEwDQYJKoZIhvcNAQEMBQAwHzEdMBsGA1UE +AxMUVGVzdCBJbnRlcm1lZGlhdGUgQ0EwIBcNMjYxMTIzMTQ0MjI3WhgPMjEyNjEw +MzAxNDQyMjdaMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBALTZaMeJofwt2sOE1JNhpGjGy9NELV5PQe46JwzF05MQ +4Syj2F5bigFaWJF/bc/tphQa1qEuN8rPhAH30gwH01aOR5yVVc2ymM2Va/W3zd0m +YUgyJoMQST95R2ILWxy9wLjWoLwmc1qyqu4QVopJChcNNAFlJUipeRCmwjHbvBN5 +WWj2RzyvNshzF97CYOJfjnvL5/eeobtna7Mj1vT1j0SJZc/RtxHmF9ZzATc6NWjP +LqeQ6ZywEimC+pm+qL9Z+pBKlBVtIJUMjOKi+1PQUQ0g9AM06BaH7iwzfQlLRynj +xnU/obQ5h945zm6k8ffmnJtNWXpHBvkL6En7pZju4z8CAwEAAaNYMFYwHQYDVR0O +BBYEFJNt7QZ47kdmd/Zez0Uf4p2SWQVtMBQGA1UdEQQNMAuCCWxvY2FsaG9zdDAf +BgNVHSMEGDAWgBTzfa80Q2Zuz7YSf1H6oRRS1WNXjTANBgkqhkiG9w0BAQwFAAOC +AQEAZl0YjIoY83rhjl9gQrHNVmIUnRPFYidWcyGolDf5EJQjzYl1ouqfcU4omVWN +cJI1grNPmg2chxuPRP755ClPj3gWrWw69f9kg2VEoVioiZ+1S/KDJp7p9pzo+dnV +vB06XndmD884Xym8S/WcbZBHZmGnzk7HJmu4FWaMZasGeOtDN06n49U3jLDL21HJ +/0seUBYRpsg7X2EELgTsIKAqqPJvpvvcUI2nMe3Xml+kCC9t7Aa6dEP/gKTRUI9d +UR1HC+elTLLQEf+IUjVxVGcPsR1kXkU9m5n0XyZsG15k19jNs6EvUPgcGOnHU81O +PgOpS4hlWrYBVndEa8KsCIXyfA== +-----END CERTIFICATE----- diff --git a/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-root.pem b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-root.pem new file mode 100644 index 0000000000..93efad7644 --- /dev/null +++ b/org.restlet/src/test/resources/org/restlet/engine/ssl/test-ca-root.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC5TCCAc2gAwIBAgIJAMboNsGZJweXMA0GCSqGSIb3DQEBDAUAMBcxFTATBgNV +BAMTDFRlc3QgUm9vdCBDQTAgFw0yNjExMjMxNDQyMjZaGA8yMTI2MTAzMDE0NDIy +NlowFzEVMBMGA1UEAxMMVGVzdCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAliL9olDyltmRvcMo4Mge8z2ZLDvfSXI1Vi7zpGMaggG6v9I4 +1eRNYWKJguVLZ8wqDsnNNcOKS+HEQNFObWNqpoLRh91uRvg15a2ZVBcx+mqfjcww +/SKxEorzUFusy3gaWkGSmJgaDxKBh0J+yruYWlZS7ezuQeG83qt+R2htxZHh63Jh +tssP41amipQzoiZoMgvYv7k3vlfFy51bc5J5hxalBcSOQnS4Wzxul12TEft11GFy +vxOIPjtV0rMfIb/4gpO7w5pBSr4UokPeS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