java6版本如何禁用,如何禁用java 1.8.181版本的端点标识

When I upgraded java from 1.8.161 to 1.8.181, I am not able to connect to LDAP from my application,

i get below exception when i try to login to application with a user that is active in LDAP.

javax.naming.CommunicationException: : [Root exception is

javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException:

No subject alternative names matching IP address found]

I found the below release notes on the Oracle site for version 1.8.181

Changes

core-libs/javax.naming

➜ Improve LDAP support

Endpoint identification has been enabled on LDAPS connections.

To improve the robustness of LDAPS (secure LDAP over TLS ) connections, endpoint identification

algorithms have been enabled by default.

Note that there may be situations where some applications that were previously able to successfully connect

to an LDAPS server may no longer be able to do so.

Such applications may, if they deem appropriate, disable endpoint identification using a

new system property: com.sun.jndi.ldap.object.disableEndpointIdentification.

Define this system property (or set it to true) to disable endpoint identification algorithms.

I tried to set the property to true as below along with other properties. But still it throws same error.

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY, ctxFactory);

env.put(Context.PROVIDER_URL, providerUrl);

env.put(Context.SECURITY_PRINCIPAL, secPrincipal);

env.put(Context.SECURITY_AUTHENTICATION, secAuthentication);

env.put(Context.SECURITY_CREDENTIALS, secCredentials);

env.put("com.sun.jndi.ldap.object.disableEndpointIdentification" ,disableEndpointIdentification);

DirContext ldapCtx = new InitialDirContext(env);

Need your help how and where exactly we need to set the property

com.sun.jndi.ldap.object.disableEndpointIdentification to true.

There is no such constant String variable related to this in Context Interface too.

If I revert back to java 1.8.161 version it works fine.

解决方案

doc tells about application system property and not about Ldap context environment

then it needs to be setup on application JVM (java command line) for the app as

-Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值