# LDAP Realm Breaking with Java 11.0.15

**URL:** https://forum.payara.fish/t/ldap-realm-breaking-with-java-11-0-15/306
**Category:** Technical Discussion
**Created:** [April 21, 2022, 7:10pm UTC](https://forum.payara.fish/t/ldap-realm-breaking-with-java-11-0-15/306 "2022-04-21T19:10:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mrr39](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mrr39](https://forum.payara.fish/u/mrr39)
#### Post date: [April 21, 2022, 7:10pm UTC](https://forum.payara.fish/t/ldap-realm-breaking-with-java-11-0-15/306/1 "2022-04-21T19:10:15Z")

</div>

Hello,

Running Payara community 2022.2 and just upgraded Java to 11.0.15 from 11.0.14, which seems to have broken LDAP Realm authentication with the following exception.

Just wanted to give a heads up and see if anyone has seen this. Hopefully, fix will simply be rolling back to Java 11.0.14.

```auto
Caused by: java.net.SocketException: Unconnected sockets not implemented
	at java.base/javax.net.SocketFactory.createSocket(SocketFactory.java:125)
	at java.naming/com.sun.jndi.ldap.Connection.createSocket(Connection.java:303)
	at java.naming/com.sun.jndi.ldap.Connection.<init>(Connection.java:231)
	... 68 more
Caused by: java.lang.UnsupportedOperationException
	at java.base/javax.net.SocketFactory.createSocket(SocketFactory.java:123)

```

-m

---

<div class="post-metadata">

### Author: ![mrr39](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mrr39](https://forum.payara.fish/u/mrr39)
#### Post date: [April 22, 2022, 12:10pm UTC](https://forum.payara.fish/t/ldap-realm-breaking-with-java-11-0-15/306/2 "2022-04-22T12:10:48Z")

</div>

And maybe this has something to do with it?

> **[Consolidated JDK 11 Release Notes](https://www.oracle.com/java/technologies/javase/11all-relnotes.html#JDK-8278972)**
>
> Consolidated JDK 11 Release Notes

---

<div class="post-metadata">

### Author: ![ondromihalyi](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.payara.fish/ondromihalyi/32/33_2.png) [@ondromihalyi](https://forum.payara.fish/u/ondromihalyi)
#### Post date: [April 22, 2022, 12:40pm UTC](https://forum.payara.fish/t/ldap-realm-breaking-with-java-11-0-15/306/3 "2022-04-22T12:40:25Z")

</div>

Hi,

From the stacktrace, this has something to do with it: [Java – “SocketException: Unconnected sockets not implemented” with self-signed SSL certificate – iTecNote](https://itecnote.com/tecnote/java-socketexception-unconnected-sockets-not-implemented-with-self-signed-ssl-certificate/)

But the method `SocketFactory.createSocket` without parameters that throws an exception has been in JDK 11 since the beginning: [jdk/SocketFactory.java at jdk-11+0 · openjdk/jdk · GitHub](https://github.com/openjdk/jdk/blob/jdk-11+0/src/java.base/share/classes/javax/net/SocketFactory.java)

Payara didn’t change anything on the LDAP socket factory either: [Payara/CustomSocketFactory.java at b263fb8b7eab9fee664cd8b0a9457ed3dc96cdd0 · payara/Payara · GitHub](https://github.com/payara/Payara/blob/b263fb8b7eab9fee664cd8b0a9457ed3dc96cdd0/nucleus/security/core/src/main/java/com/sun/enterprise/security/auth/realm/ldap/CustomSocketFactory.java#L95) (it doesn’t override the `SocketFactory.createSocket()` method).

Something must have caused that the method `SocketFactory.createSocket()` is now called while it wasn’t called before.

Does it fix your issue if you set `-Dcom.sun.jndi.ldapURLParsing=legacy`?

All the best,  
Ondro

---

<div class="post-metadata">

### Author: ![mrr39](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mrr39](https://forum.payara.fish/u/mrr39)
#### Post date: [April 22, 2022, 12:42pm UTC](https://forum.payara.fish/t/ldap-realm-breaking-with-java-11-0-15/306/4 "2022-04-22T12:42:18Z")

</div>

That’s exactly what I’m trying now. I’ll let you know if that does it.

Thanks!

---

<div class="post-metadata">

### Author: ![mrr39](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mrr39](https://forum.payara.fish/u/mrr39)
#### Post date: [April 22, 2022, 2:53pm UTC](https://forum.payara.fish/t/ldap-realm-breaking-with-java-11-0-15/306/5 "2022-04-22T14:53:52Z")

</div>

Hi again,

Unfortunately, this doesn’t seem to address the problem. Which makes me wonder if I’m adding the system property incorrectly.

I’ve added `<jvm-options>-Dcom.sun.jndi.ldapURLParsing=legacy</jvm-options>` to my domain.xml file. And on start up I see` -Dcom.sun.jndi.ldapURLParsing=legacy` in the logs.

That’s correct, right?

If so, is it possible that the system property itself is incorrect? That is how the JDK release notes show it, but is there another source to verify what the format of that property should be?

Thanks,

Mike
