Announcement

Collapse
No announcement yet.

[MC3.4.2] LDAPS/JNDI: javax.naming.CommunicationException: simple bind failed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [MC3.4.2] LDAPS/JNDI: javax.naming.CommunicationException: simple bind failed

    Hello,

    I try to connect to a LDAP server using LDAPS protocol.
    In my transformer, I set up the connection using JNDI.

    Code:
    try {
    	var lEnvironment = new Hashtable();	
    	lEnvironment.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    	lEnvironment.put(Context.PROVIDER_URL, "ldaps://myip:636/");
    	lEnvironment.put(Context.SECURITY_PROTOCOL, "ssl");	        
    	lEnvironment.put(Context.SECURITY_AUTHENTICATION, "simple");
    	lEnvironment.put(Context.SECURITY_PRINCIPAL, "cn=XXX,ou=YYYY,ou=accounts,ou=AAA,dc=BBB,dc=fr");
    	lEnvironment.put(Context.SECURITY_CREDENTIALS, "mypassword");
    	logger.debug("Environnement variables set up");
    
    	logger.debug("Connection ... ");
    	var ctrl = Packages.java.lang.reflect.Array.newInstance(Control, 1);
    	var lLdapContext = new InitialLdapContext(lEnvironment, ctrl[0]);
    	logger.debug("Connected !");
    I get an exception :

    Transformer error
    ERROR MESSAGE: Error evaluating transformer
    com.mirth.connect.server.MirthJavascriptTransforme rException:
    CHANNEL: RPPS_TO_MSS_OK
    CONNECTOR: sourceConnector
    SCRIPT SOURCE: TRANSFORMER
    SOURCE CODE:
    134:
    135: logger.debug("All done");
    136: } catch (e) {
    137: // TODO Auto-generated catch block
    138: logger.debug(e);
    139: throw(e);
    140: }
    141: if ('xml' === typeof msg) {
    142: if (msg.hasSimpleContent()) {
    143: msg = msg.toXMLString();
    LINE NUMBER: 139
    DETAILS: JavaException: javax.naming.CommunicationException: simple bind failed: myip:636
    at da77e210-3fa9-4c77-a25a-261d01e2e344:139 (doTransform)
    at da77e210-3fa9-4c77-a25a-261d01e2e344:162 (doScript)
    at da77e210-3fa9-4c77-a25a-261d01e2e344:164
    at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:154)
    at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:119)
    at com.mirth.connect.server.util.javascript.JavaScrip tTask.call(JavaScriptTask.java:113)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)


    I guess it is a certificate loading issue because when I issue the same search using ldapsearch utility on the server, It works.

    Do we have to do something special to load the certificate or the JAVA keystore ?
    Certificate is imported into the defaut/jre cacert keystore.

    I read something about the trsutstore keystore in /mirthconnect/appdata. I have created it with no success.


    Thank for your help.
Working...
X