-
Bug
-
Resolution: Done
-
Major
-
26.1.1.Final
-
None
-
-
Compatibility/Configuration
-
Low
-
---
-
---
On Wildfly 26.1.1, Debian Buster and Temurin 17.0.4, I cannot use the smallrye-graphql-client because its netty dns resolution ignores the system defaults and uses Google's public DNS servers as a fallback. As netty-resolver-dns is bundled as a module in Wildfly, I thought I should address this issue here.
Netty tries to use JNDI to lookup the DNS servers, but fails (silently with an empty catch block!) in io.netty.resolver.dns.DirContextUtils#addNameServers with
java.lang.IllegalAccessException: class org.jboss.as.naming.InitialContext cannot access class com.sun.jndi.dns.DnsContextFactory (in module jdk.naming.dns) because module jdk.naming.dns does not export com.sun.jndi.dns to unnamed module @32a32c84
and then defaults to Google.
We fixed this by adding
--add-exports=jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED
to our JAVA_OPTS. Should this be set per default in WildFly, given it bundles this netty module?
Extra concerning: in our environments we experienced DNS timeouts as the Internet is blocked, but if it wasn't blocked, we'd have leaked our DNS requests unencrypted over the public internet to Google.
- is blocked by
-
WFLY-17105 Upgrade WildFly Core to 19.0.0.Final
- Closed
- is caused by
-
WFCORE-6087 Add --add-exports=jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED to default JPMS settings
- Closed