Reputation: 531
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 welcome!
<?xml version="1.0" encoding="UTF-8"?>
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>
Upvotes: 0
Views: 270
Reputation: 7035
It is this line from the config you posted that creates the link
<prop key="java.naming.ldap.factory.socket" value="zotix.co.util.CustomSocketFactory"/>
I guess that normally an instance of zotix.co.util.CustomSocketFactory
is created. But because there is already one in the Spring context it uses that one. Therefore no explicit link between the two beans is needed.
I am only guessing, but you can test that by (de-)activating the customSocketFactory
bean. If this switches between a standard (non-SSL) and the SSL factory, it seems to be like this.
Upvotes: 1