RFR: 8049630: Custom socket factory is not checked for the existence of a getDefault() method
Can I please get a review of this change which addresses the issues noted in https://bugs.openjdk.org/browse/JDK-8049630 and https://bugs.openjdk.org/browse/JDK-8049619? The `java.naming` module allows for the `java.naming.ldap.factory.socket` environment property to be configured to point to the class name of the implementation of a `javax.net.SocketFactory`. As noted in the specification of that property https://docs.oracle.com/en/java/javase/25/docs/api/java.naming/module-summar...:
The value of this environment property specifies the fully qualified class name of the socket factory used by the LDAP provider. This class must implement the SocketFactory abstract class and provide an implementation of the static "getDefault()" method that returns an instance of the socket factory.
The implementation in the JDK default LDAP provider currently doesn't verify that the given class name points to a type which is `javax.net.SocketFactory`, nor does it verify that the correct expected `getDefault()` method exists. The changes in this PR addresses that issue and introduces a jtreg test to reproduce the issue and verify the fix. Given the nature of this change, I believe a CSR will be needed which I'll file shortly. ------------- Commit messages: - 8049630: Custom socket factory is not checked for the existence of a getDefault() method Changes: https://git.openjdk.org/jdk/pull/29706/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29706&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8049630 Stats: 180 lines in 3 files changed: 167 ins; 0 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/29706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/29706/head:pull/29706 PR: https://git.openjdk.org/jdk/pull/29706
On Fri, 13 Feb 2026 02:19:31 GMT, Jaikiran Pai <jpai@openjdk.org> wrote:
Can I please get a review of this change which addresses the issues noted in https://bugs.openjdk.org/browse/JDK-8049630 and https://bugs.openjdk.org/browse/JDK-8049619?
The `java.naming` module allows for the `java.naming.ldap.factory.socket` environment property to be configured to point to the class name of the implementation of a `javax.net.SocketFactory`. As noted in the specification of that property https://docs.oracle.com/en/java/javase/25/docs/api/java.naming/module-summar...:
The value of this environment property specifies the fully qualified class name of the socket factory used by the LDAP provider. This class must implement the SocketFactory abstract class and provide an implementation of the static "getDefault()" method that returns an instance of the socket factory.
The implementation in the JDK default LDAP provider currently doesn't verify that the given class name points to a type which is `javax.net.SocketFactory`, nor does it verify that the correct expected `getDefault()` method exists. The changes in this PR addresses that issue and introduces a jtreg test to reproduce the issue and verify the fix.
Given the nature of this change, I believe a CSR will be needed which I'll file shortly.
The CSR is now ready for review https://bugs.openjdk.org/browse/JDK-8377864 ------------- PR Comment: https://git.openjdk.org/jdk/pull/29706#issuecomment-3895116796
On Fri, 13 Feb 2026 02:19:31 GMT, Jaikiran Pai <jpai@openjdk.org> wrote:
Can I please get a review of this change which addresses the issues noted in https://bugs.openjdk.org/browse/JDK-8049630 and https://bugs.openjdk.org/browse/JDK-8049619?
The `java.naming` module allows for the `java.naming.ldap.factory.socket` environment property to be configured to point to the class name of the implementation of a `javax.net.SocketFactory`. As noted in the specification of that property https://docs.oracle.com/en/java/javase/25/docs/api/java.naming/module-summar...:
The value of this environment property specifies the fully qualified class name of the socket factory used by the LDAP provider. This class must implement the SocketFactory abstract class and provide an implementation of the static "getDefault()" method that returns an instance of the socket factory.
The implementation in the JDK default LDAP provider currently doesn't verify that the given class name points to a type which is `javax.net.SocketFactory`, nor does it verify that the correct expected `getDefault()` method exists. The changes in this PR addresses that issue and introduces a jtreg test to reproduce the issue and verify the fix.
Given the nature of this change, I believe a CSR will be needed which I'll file shortly.
Nice cleanup. I agree that CSR and release notes are needed. Thanks for drafting those already. ------------- Marked as reviewed by dfuchs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/29706#pullrequestreview-3796190614
On Fri, 13 Feb 2026 02:19:31 GMT, Jaikiran Pai <jpai@openjdk.org> wrote:
Can I please get a review of this change which addresses the issues noted in https://bugs.openjdk.org/browse/JDK-8049630 and https://bugs.openjdk.org/browse/JDK-8049619?
The `java.naming` module allows for the `java.naming.ldap.factory.socket` environment property to be configured to point to the class name of the implementation of a `javax.net.SocketFactory`. As noted in the specification of that property https://docs.oracle.com/en/java/javase/25/docs/api/java.naming/module-summar...:
The value of this environment property specifies the fully qualified class name of the socket factory used by the LDAP provider. This class must implement the SocketFactory abstract class and provide an implementation of the static "getDefault()" method that returns an instance of the socket factory.
The implementation in the JDK default LDAP provider currently doesn't verify that the given class name points to a type which is `javax.net.SocketFactory`, nor does it verify that the correct expected `getDefault()` method exists. The changes in this PR addresses that issue and introduces a jtreg test to reproduce the issue and verify the fix.
Given the nature of this change, I believe a CSR will be needed which I'll file shortly.
Very good cleanup, and clarification of expectations for the `java.naming.ldap.factory.socket` JNDI/LDAP environment property value. Looks good to me, thank you! ------------- Marked as reviewed by aefimov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/29706#pullrequestreview-3796562178
participants (3)
-
Aleksei Efimov
-
Daniel Fuchs
-
Jaikiran Pai