Skip to content

Conversation

@CatiaCorreia
Copy link

Add to EmbeddedLdapProperties:
-boolean ldaps
-String sslBundleName
Create setLdapsListener method to create and set the LDAPS listener for the server. Add test for new embedded LDAP setup.
Issue#48060

Signed-off-by: CatiaCorreia catia.correia97@gmail.com

Add to EmbeddedLdapProperties:
-boolean ldaps
-String sslBundleName
Create setLdapsListener method to create and set the LDAPS listener for the server.
Add test for new embedded LDAP setup.
Issue#48060

Signed-off-by: CatiaCorreia <catia.correia97@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 27, 2025
Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please review the proposal. I've added a couple of comments for a start.

}
}

@ConditionalOnBean(SslBundles.class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what this is but you can't add a condition on a private method. What's that supposed to do?

}

@Test
void testLdapsVersion() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't test the SSL bundles, nor the binding. It doesn't work atm anyway (see previous comment).

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Nov 27, 2025
Copy link
Member

@wilkinsona wilkinsona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for the PR, @CatiaCorreia. I've left a few comments for your consideration.

Comment on lines +60 to +68
/**
* Listener type.
*/
private boolean ldaps;

/**
* Embedded LDAPS client SSL bundle name.
*/
@Nullable private String sslBundleName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with other SSL configuration in Spring Boot, the properties should be grouped together in an SSL inner-class. That class should have an enabled property, a bundle property as well as properties for configuring things without using an SSL bundle. org.springframework.boot.amqp.autoconfigure.RabbitProperties.Ssl is a client-side example of that sort of arrangement.

}

@Bean
InMemoryDirectoryServer directoryServer(ApplicationContext applicationContext) throws LDAPException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SslBundles should be injected here using ObjectProvider<SslBundles> sslBundles. You can then use getIfAvailable() to get the bean if it exists or null if it does not.

}
}

@ConditionalOnBean(SslBundles.class)
Copy link
Member

@wilkinsona wilkinsona Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't have any effect here as conditions only work on classes and @Bean methods. It can be removed if you inject SslBundles as suggested above.

@CatiaCorreia
Copy link
Author

Thank you for all the feedback. I will start working on the changes right away.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 28, 2025
@wilkinsona wilkinsona added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Nov 30, 2025
@CatiaCorreia
Copy link
Author

I'm writing this message to give a status report. I have implemented the changes discussed above and have tried testing them. I believe I have successfully implemented the creation of the server with SSL without SslBundles. However when it comes to the SslBundles I haven't been able to get a successful test even thought I can't find a problem. There seems to be a problem when the client tries to get a connection to the server (LDAPException code 91). I have committed the changes to a separate branch as I was unsure if I should commit them to this one directly. The branch is found here: https://github.com/CatiaCorreia/spring-boot/tree/gh%2348060-Troubleshooting
At this stage I am trying to ascertain the motive for this error.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants