【问题标题】:Question about configuring SSL for CAMEL LDAP关于为 CAMEL LDAP 配置 SSL 的问题
【发布时间】:2019-04-30 20:09:44
【问题描述】:

目前我正在阅读文档http://camel.apache.org/ldap.html

并尝试为 LDAP 配置 SSL,我没有找到 bean 的方式或位置 ldapserver 指的是 bean customSocketFactory。 任何建议或提示都非常受欢迎!

<?xml version="1.0" encoding="UTF-8"?>

https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprinthttp://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>

【问题讨论】:

    标签: apache-camel


    【解决方案1】:

    正是您发布的配置中的这一行创建了链接

    <prop key="java.naming.ldap.factory.socket" value="zotix.co.util.CustomSocketFactory"/>
    

    我猜通常会创建一个zotix.co.util.CustomSocketFactory 的实例。但是因为在 Spring 上下文中已经有一个,所以它使用那个。因此两个 bean 之间不需要显式链接

    我只是猜测,但您可以通过(取消)激活customSocketFactory bean 来测试它。如果这在标准(非 SSL)和 SSL 工厂之间切换,它似乎是这样的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-06
      • 1970-01-01
      • 1970-01-01
      • 2011-03-27
      • 1970-01-01
      • 2018-04-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多