rishabhdaim commented on code in PR #3077:
URL: https://github.com/apache/jackrabbit-oak/pull/3077#discussion_r3766660830


##########
oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java:
##########
@@ -230,7 +236,15 @@ private void startLdapServer() throws Exception {
     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);

Review Comment:
   Run it behind an `enableSSL` flag. No need for non-SSL tests.



##########
oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java:
##########
@@ -449,5 +463,11 @@ protected void tearDown() throws Exception {
         if (cacheService != null) {
             cacheService.destroy();
         }
+        if (previousKeyStoreType == null) {

Review Comment:
   If this was initially empty, then don't set it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to