web stats
[MC3.4.2] LDAPS/JNDI: javax.naming.CommunicationException: simple bind failed - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-03-2017, 06:16 AM
lionelroux lionelroux is offline
OBX.2 Kenobi
 
Join Date: Apr 2013
Posts: 82
lionelroux is on a distinguished road
Exclamation [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.
Reply With Quote
Reply

Tags
ldap

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:34 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation