On Thu, 23 Apr 2026 15:05:01 GMT, Mikhail Yankelevich <[email protected]> wrote:
>> In DNS-based KDC discovery failures are exposed as generic 'KrbException: >> Cannot locate KDC / Unable to locate KDC for realm <REALM>' with no >> indication whether the underlying DNS SRV lookup failed due to NXDOMAIN, >> SERVFAIL, or a communication timeout. >> >> To improve supportability, this patch updates >> `KrbServiceLocator.getKerberosService(realm, protocol)` to rethrow the >> original JNDI NamingException from the SRV lookup and attach a sanitized >> failure category to the existing KrbException when both udp and tcp >> discovery attempts fail, while preserving the original top level exception >> message. `Config.getKDCFromDNS()` is updated to catch exception, sanitize it >> into the relevant category to prevent leaking any senistive information and >> attach it to the existing KrbException. >> >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > src/java.security.jgss/share/classes/sun/security/krb5/Config.java line 1391: > >> 1389: String kdcs = ""; >> 1390: String[] srvs = null; >> 1391: NamingException udpNE = null; > > I think this might be a bit hard to read, what do you think about making the > name longer like `udpNamingException` so it's clear at a glance? > If you prefer as is i'm fine with it Thanks @myankelev, happy to follow up on these, however I was about to update the PR to a simple debug log output and remove the tests for simplicity, any objections/thoughts? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30824#discussion_r3132408641
