Discussion:
configure SSL for CAMEL LDAP
Wang Yan
2018-11-27 09:40:00 UTC
Permalink
Currently I am reading the document http://camel.apache.org/ldap.html

and try to configure SSL for LDAP , I did not find how or where the bean
ldapserver refers to the bean customSocketFactory.

Any suggestions or hints are more than weclome!


<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">


<sslContextParameters xmlns="http://camel.apache.org/schema/blueprint"
id="sslContextParameters">
<keyManagers
keyPassword="{{keystore.pwd}}">
<keyStore
resource="{{keystore.url}}"
password="{{keystore.pwd}}"/>
</keyManagers>
</sslContextParameters>

<bean id="customSocketFactory" class="zotix.co.util.CustomSocketFactory">
<argument ref="sslContextParameters" />
</bean>
<bean id="ldapserver"
class="javax.naming.directory.InitialDirContext" scope="prototype">
<argument>
<props>
<prop key="java.naming.factory.initial"
value="com.sun.jndi.ldap.LdapCtxFactory"/>
<prop key="java.naming.provider.url"
value="ldaps://lab.zotix.co:636"/>
<prop key="java.naming.security.protocol" value="ssl"/>
<prop key="java.naming.security.authentication"
value="simple" />
<prop key="java.naming.security.principal"
value="cn=Manager,dc=example,dc=com"/>
<prop key="java.naming.security.credentials" value="passw0rd"/>
<prop key="java.naming.ldap.factory.socket"
value="zotix.co.util.CustomSocketFactory"/>
</props>
</argument>
</bean>
</blueprint>
Wang Yan
2018-12-05 10:05:25 UTC
Permalink
it does not work got exception as below

#camel xmlroute scan
camel.springboot.xmlRoutes: on
camel.springboot.xmlRoutes: file:camel/*.xml


Caused by: java.lang.IllegalStateException: duplicate key:
camel.springboot.xmlRoutes


---------- Forwarded message ---------
From: Wang Yan <***@gmail.com>
Date: Tue, Nov 27, 2018 at 10:40 AM
Subject: configure SSL for CAMEL LDAP
To: <***@camel.apache.org>



Currently I am reading the document http://camel.apache.org/ldap.html

and try to configure SSL for LDAP , I did not find how or where the bean
ldapserver refers to the bean customSocketFactory.

Any suggestions or hints are more than weclome!


<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">


<sslContextParameters xmlns="http://camel.apache.org/schema/blueprint"
id="sslContextParameters">
<keyManagers
keyPassword="{{keystore.pwd}}">
<keyStore
resource="{{keystore.url}}"
password="{{keystore.pwd}}"/>
</keyManagers>
</sslContextParameters>

<bean id="customSocketFactory" class="zotix.co.util.CustomSocketFactory">
<argument ref="sslContextParameters" />
</bean>
<bean id="ldapserver"
class="javax.naming.directory.InitialDirContext" scope="prototype">
<argument>
<props>
<prop key="java.naming.factory.initial"
value="com.sun.jndi.ldap.LdapCtxFactory"/>
<prop key="java.naming.provider.url"
value="ldaps://lab.zotix.co:636"/>
<prop key="java.naming.security.protocol" value="ssl"/>
<prop key="java.naming.security.authentication"
value="simple" />
<prop key="java.naming.security.principal"
value="cn=Manager,dc=example,dc=com"/>
<prop key="java.naming.security.credentials" value="passw0rd"/>
<prop key="java.naming.ldap.factory.socket"
value="zotix.co.util.CustomSocketFactory"/>
</props>
</argument>
</bean>
</blueprint>

Loading...