You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ba...@apache.org on 2026/08/12 11:55:50 UTC

(jackrabbit-oak) branch OAK-12346 updated: OAK-12346: Oak should compile & test on Java 26

This is an automated email from the ASF dual-hosted git repository.

mbaedke pushed a commit to branch OAK-12346
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/OAK-12346 by this push:
     new 698caecc3b OAK-12346: Oak should compile & test on Java 26
698caecc3b is described below

commit 698caecc3b81c11817122b1756bb4821526028ec
Author: Manfred Baedke <ma...@gmail.com>
AuthorDate: Wed Aug 12 13:54:12 2026 +0200

    OAK-12346: Oak should compile & test on Java 26
    
    Now using contemporary algorithms for tests in oak-auth-ldap.
---
 .../authentication/ldap/AbstractServer.java        |  22 ++++++++++++++++++++-
 .../authentication/ldap/apacheds-server.jks        | Bin 0 -> 2190 bytes
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java b/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java
index f3b89c3480..4b4126c175 100644
--- a/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java
+++ b/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java
@@ -28,7 +28,9 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.BindException;
+import java.net.URL;
 import java.nio.file.Files;
+import java.security.Security;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -81,6 +83,9 @@ import org.slf4j.LoggerFactory;
 public abstract class AbstractServer {
 
     public static final String  EXAMPLE_DN = "dc=example,dc=com";
+    private static final String TLS_KEYSTORE_RESOURCE = "org/apache/jackrabbit/oak/security/authentication/ldap/apacheds-server.jks";
+    private static final String TLS_KEYSTORE_PASSWORD = "secret";
+    private static final String KEYSTORE_TYPE_PROPERTY = "keystore.type";
 
     private static final Logger LOG = LoggerFactory.getLogger(AbstractServer.class);
     private static final List<LdifEntry> EMPTY_LIST = Collections.unmodifiableList(new ArrayList<LdifEntry>(0));
@@ -104,6 +109,7 @@ public abstract class AbstractServer {
     protected LdapServer ldapServer;
     
     protected boolean enableSSL = false;
+    private String previousKeyStoreType;
 
     public AbstractServer(boolean enableSSL) {
         this.enableSSL = enableSSL;
@@ -230,7 +236,15 @@ public abstract class AbstractServer {
     protected void setupLdapServer() throws Exception {
         TcpTransport transport = new TcpTransport((port));
         transport.enableSSL(enableSSL);
-        
+
+        URL keyStoreUrl = AbstractServer.class.getClassLoader().getResource(TLS_KEYSTORE_RESOURCE);
+        if (keyStoreUrl == null) {
+            throw new IOException("Unable to locate test TLS keystore: " + TLS_KEYSTORE_RESOURCE);
+        }
+        previousKeyStoreType = Security.getProperty(KEYSTORE_TYPE_PROPERTY);
+        Security.setProperty(KEYSTORE_TYPE_PROPERTY, "jks");
+        ldapServer.setKeystoreFile(new File(keyStoreUrl.toURI()).getAbsolutePath());
+        ldapServer.setCertificatePassword(TLS_KEYSTORE_PASSWORD);
         ldapServer.setTransports(transport);
         ldapServer.setDirectoryService(directoryService);
         ldapServer.addExtendedOperationHandler(new StartTlsHandler());
@@ -449,5 +463,11 @@ public abstract class AbstractServer {
         if (cacheService != null) {
             cacheService.destroy();
         }
+        if (previousKeyStoreType == null) {
+            Security.setProperty(KEYSTORE_TYPE_PROPERTY, "pkcs12");
+        } else {
+            Security.setProperty(KEYSTORE_TYPE_PROPERTY, previousKeyStoreType);
+        }
+        previousKeyStoreType = null;
     }
 }
diff --git a/oak-auth-ldap/src/test/resources/org/apache/jackrabbit/oak/security/authentication/ldap/apacheds-server.jks b/oak-auth-ldap/src/test/resources/org/apache/jackrabbit/oak/security/authentication/ldap/apacheds-server.jks
new file mode 100644
index 0000000000..0b115fd84a
Binary files /dev/null and b/oak-auth-ldap/src/test/resources/org/apache/jackrabbit/oak/security/authentication/ldap/apacheds-server.jks differ