为什么即使 verifyHostname 为 false,仍会进行主机名验证?

问题描述 投票:0回答:2

在尝试让安全的休息服务在容器中的 Open Liberty 上运行时,我收到以下错误: CWPKI0824E: SSL 握手失败:连接到主机 [hostname] 时发生主机名验证错误。 用于访问服务器的主机名与服务器证书的SubjectDN 或Subject Alternative Name 信息不匹配。 SSL 握手异常的扩展错误消息是:[未找到与主机名匹配的名称]。

server.xml 的相关部分:

<featureManager>
    <feature>appSecurity-3.0</feature>
    <feature>jca-1.7</feature>
    <feature>jdbc-4.1</feature>
    <feature>jndi-1.0</feature>
    <feature>localConnector-1.0</feature>
    <feature>mpConfig-1.3</feature>
    <feature>passwordUtilities-1.0</feature>
    <feature>ssl-1.0</feature>
    <feature>transportSecurity-1.0</feature>
</featureManager>

<sslDefault sslRef="DefaultSSLConfig" httpHostNameVerification="false"/>

<ssl id="DefaultSSLConfig" keyStoreRef="DefaultKeyStore" trustStoreRef="DefaultTrustStore" trustDefaultCerts="true" verifyHostname="false"/>

<keyStore id="DefaultKeyStore" location="liberty-default-key.p12" type="PKCS12" password="password"/>
<keyStore id="DefaultTrustStore" location="liberty-default-trust.p12" type="PKCS12" password="password"/>

<ldapRegistry id="ldapRegistry" realm="Standalone LDAP Registry" ldapType="IBM Tivoli Directory Server"
    host="server" port="123"
    baseDN="baseDN" bindDN="bindDN" bindPassword="password"
    recursiveSearch="true"
    sslEnabled="true" sslRef="DefaultSSLConfig">
    <idsFilters>
        ...
    </idsFilters>
</ldapRegistry>

如您所见,verifyHostname 的值为“false”,但检查仍然完成。 我错过了什么?

ssl websphere-liberty open-liberty
2个回答
2
投票

JDK 单独处理 LDAP,并且 JDK 默认启用主机名验证。要禁用 LDAP 主机名验证,您需要将系统属性 com.sun.jndi.ldap.object.disableEndpointIdentification 设置为 true。 因此,在服务器目录中的 jvm.options 中添加 -Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true 以禁用 LDAP 连接上的主机名验证。


0
投票

Answer 对我在 DOORS Next 7.03 和 Jazz Auth 服务器中看到的这些错误有效。

© www.soinside.com 2019 - 2024. All rights reserved.