[xwiki-devs] LDAP ssl authentication problems with IBM WAS6.1
Hello, I'm runnig xwiki-enterprise-web-1.3.2 in a WebSphere Application Server 6.1. I'm trying to use the ldap authentication but I get the following exception: [4/30/08 12:20:56:890 CEST] 0000006d SystemErr R Caused by: java.lang.NoClassDefFoundError: com.sun.net.ssl.internal.ssl.Provider at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:68) at java.lang.J9VMInternals.initialize(J9VMInternals.java:129) at com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.ldapAuthenticate(XWikiLDAPAuthServiceImpl.java:160) at com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.authenticate(XWikiLDAPAuthServiceImpl.java:107) This is caused by the missing com.sun.net.ssl.internal.ssl.Provider class in the IBM JVM. I have had a look on the code and I saw that the com.xpn.xwiki.plugin.ldap.XWikiLDAPConnection is creating a com.sun.net.ssl.internal.ssl.Provider instance in static way: Security.addProvider(new Provider()); A strong coupling between the application and the JVC implementation is the consequence. A possible solution can be: create the provider dynamically using a configuration variable: try { ClassLoader cl = Thread.currentThread().getContextClassLoader(); String className = config.getLDAPParam("ldap_ssl_provider", "com.sun.net.ssl.internal.ssl.Provider", context); java.security.Provider provider = (java.security.Provider) cl.loadClass(className) .newInstance(); Security.addProvider(provider); } catch (Exception e) { throw new XWikiLDAPException("LDAP bind failed loading security provider " + className, e); } Marco Marini Unicredit Global Information Serivecs SpA Application Architectures and Development Application Architectures Application Integration and Framework Via Monte Bianco, 18 - 37132 Verona Tel. +39 045 808 4518 Mobile +39 335 1993 954 Fax +39 045 808 4599 [email protected] This e-mail is confidential and may also contain privileged information. If you are not the intended recipient you are not authorised to read, print, save, process or disclose this message. If you have received this message by mistake, please inform the sender immediately and delete this e-mail, its attachments and any copies. Any use, distribution, reproduction or disclosure by any person other than the intended recipient is strictly prohibited and the person responsible may incur penalties. Thank you!
Hi, Good idea, I totally forgot differences between JVM implementations. See http://jira.xwiki.org/jira/browse/XWIKI-2354 On Wed, Apr 30, 2008 at 3:07 PM, Marini Marco (UGIS - UniCredit Group) <[email protected]> wrote:
Hello,
I'm runnig xwiki-enterprise-web-1.3.2 in a WebSphere Application Server 6.1. I'm trying to use the ldap authentication but I get the following exception:
[4/30/08 12:20:56:890 CEST] 0000006d SystemErr R Caused by: java.lang.NoClassDefFoundError: com.sun.net.ssl.internal.ssl.Provider at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:68) at java.lang.J9VMInternals.initialize(J9VMInternals.java:129) at com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.ldapAuthenticate(XWikiLDAPAuthServiceImpl.java:160) at com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.authenticate(XWikiLDAPAuthServiceImpl.java:107)
This is caused by the missing com.sun.net.ssl.internal.ssl.Provider class in the IBM JVM. I have had a look on the code and I saw that the com.xpn.xwiki.plugin.ldap.XWikiLDAPConnection is creating a com.sun.net.ssl.internal.ssl.Provider instance in static way:
Security.addProvider(new Provider());
A strong coupling between the application and the JVC implementation is the consequence. A possible solution can be: create the provider dynamically using a configuration variable:
try { ClassLoader cl = Thread.currentThread().getContextClassLoader(); String className = config.getLDAPParam("ldap_ssl_provider", "com.sun.net.ssl.internal.ssl.Provider", context); java.security.Provider provider = (java.security.Provider) cl.loadClass(className) .newInstance(); Security.addProvider(provider); } catch (Exception e) { throw new XWikiLDAPException("LDAP bind failed loading security provider " + className, e); }
Marco Marini Unicredit Global Information Serivecs SpA Application Architectures and Development Application Architectures Application Integration and Framework Via Monte Bianco, 18 - 37132 Verona Tel. +39 045 808 4518 Mobile +39 335 1993 954 Fax +39 045 808 4599 [email protected]
This e-mail is confidential and may also contain privileged information. If you are not the intended recipient you are not authorised to read, print, save, process or disclose this message. If you have received this message by mistake, please inform the sender immediately and delete this e-mail, its attachments and any copies. Any use, distribution, reproduction or disclosure by any person other than the intended recipient is strictly prohibited and the person responsible may incur penalties. Thank you!
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
participants (2)
-
Marini Marco (UGIS - UniCredit Group) -
Thomas Mortagne