Skip to content

Ldap over SSL issue in native image #724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kartik-kaushik opened this issue Jan 25, 2023 · 3 comments
Closed

Ldap over SSL issue in native image #724

kartik-kaushik opened this issue Jan 25, 2023 · 3 comments
Assignees
Labels
in: core status: duplicate A duplicate of another issue

Comments

@kartik-kaushik
Copy link

Describe the bug
Spring Boot 3 native image not working with spring-ldap over ssl

Sample
Via the Spring Initializer, create any project with:

spring-boot-starter-parent:3.0.2
spring-boot-starter-data-ldap
spring-boot-starter-actuator

Application.properties
spring.ldap.urls=ldaps://localhost:636
spring.ldap.base=ou=people,dc=admin,dc=com
spring.ldap.username=cn=admin,ou=service_accounts,dc=com
spring.ldap.password=password
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*

Check with actuator health endpoint. The application works normally, but with native image giving error:

Caused by: javax.naming.CommunicationException: localhost:636
at [email protected]/com.sun.jndi.ldap.Connection.(Connection.java:253) ~[na:na]
at [email protected]/com.sun.jndi.ldap.LdapClient.(LdapClient.java:137) ~[na:na]
at [email protected]/com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1616) ~[na:na]
at [email protected]/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2848) ~[na:na]
at [email protected]/com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:348) ~[na:na]
at [email protected]/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225) ~[spring-ldaps:na]
at [email protected]/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189) ~[spring-ldaps:na]
at [email protected]/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243) ~[spring-ldaps:na]
at [email protected]/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154) ~[spring-ldaps:na]
at [email protected]/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84) ~[spring-ldaps:na]
at [email protected]/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:732) ~[spring-ldaps:na]
at [email protected]/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) ~[spring-ldaps:na]
at [email protected]/javax.naming.InitialContext.init(InitialContext.java:236) ~[spring-ldaps:na]
at [email protected]/javax.naming.ldap.InitialLdapContext.(InitialLdapContext.java:154) ~[na:na]
at org.springframework.ldap.core.support.LdapContextSource.getDirContextInstance(LdapContextSource.java:42) ~[spring-ldaps:3.0.0]
at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:351) ~[spring-ldaps:3.0.0]
... 75 common frames omitted
Caused by: java.lang.NoSuchMethodException: javax.net.ssl.SSLSocketFactory.getDefault()
at [email protected]/java.lang.Class.getMethod(DynamicHub.java:2227) ~[spring-ldaps:na]
at [email protected]/com.sun.jndi.ldap.Connection.createSocket(Connection.java:293) ~[na:na]
at [email protected]/com.sun.jndi.ldap.Connection.(Connection.java:232) ~[na:na]
... 90 common frames omitted

Kindly help in resolution of the same. If not supported, is there any alternative or work around for now?

@kartik-kaushik
Copy link
Author

kartik-kaushik commented Jan 30, 2023

@jzheaux Any update on it or tentative date or workaround?

@jzheaux
Copy link
Collaborator

jzheaux commented Feb 7, 2023

This appears to be a duplicate of #723. Have you already tried the workaround there?

@jzheaux jzheaux self-assigned this Feb 7, 2023
@jzheaux jzheaux added type: bug A general bug in: core status: waiting-for-feedback We need additional information before we can continue status: duplicate A duplicate of another issue labels Feb 7, 2023
@jzheaux
Copy link
Collaborator

jzheaux commented Apr 18, 2023

I'm closing this due to lack of activity. If there is more to discuss, we can re-open at that time.

@jzheaux jzheaux closed this as completed Apr 18, 2023
@jzheaux jzheaux removed status: waiting-for-feedback We need additional information before we can continue type: bug A general bug labels Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants