Connection DNS resolution and SSL validation after DBeaver 23.3 per-connection truststore change
0 reputation · 31 Jul 2022, 21:35 UTC
0 reputation · 31 Jul 2022, 21:35 UTC
DBeaver delegates DNS lookups to the underlying JVM, which caches results according to the networkaddress.cache.ttl system property. The UI does not expose a runtime control to invalidate that cache for a specific connection.
Starting with DBeaver 23.3, a per-connection property useCustomTruststore allows distinct truststores per connection. The connection wizard supports selecting a custom truststore, but there is no documented per-connection setting to disable or adjust hostname verification. Hostname verification therefore remains tied to JVM-wide security settings.
With no built-in mechanism to flush DNS or refresh SSL session caches from within the client, the behavior for dynamic DNS updates and certificate rotations without restarting DBeaver is unclear.
Is there a supported way to refresh JVM DNS resolution for an existing DBeaver connection without restarting the application? Is hostname verification controllable per connection in DBeaver 23.3 and later, or only via global JVM properties? How does per-connection truststore handling interact with certificate rotation for an active connection?
33775 reputation · 01 Aug 2022, 05:15 UTC
There is no supported way to flush the JVM DNS cache or refresh hostname verification for an existing DBeaver connection without restarting the application. Hostname verification is controlled only by global JVM/JSSE settings; the per‑connection truststore does not affect it and does not cause an active connection to pick up a rotated certificate until a new connection is established (or DBeaver is restarted).
DBeaver delegates name resolution and SSL context creation to the underlying Java Runtime. The JVM caches successful DNS lookups according to the networkaddress.cache.ttlSSLContext for that connection, but the hostname verification algorithm (EndpointIdentificationAlgorithm) remains governed by the JVM-wide JSSE security properties. Consequently, changes to the truststore or DNS take effect only for newly created connections or after a JVM restart.
PKIX path building failed.UnknownHostException in the DBeaver log and are often due to stale JVM DNS cache or incorrect proxy settings.ping or nslookup .keytool -list -keystore -storepass .-Dnetworkaddress.cache.ttl=0 (or a negative value to disable caching) to DBeaver’s vmoptions file. This change requires a restart of DBeaver to take effect.-Djsse.enableSNIExtension=false or -Djdk.tls.rejectClientInitiatedRenegotiation=true in the same vmoptions file, again requiring a restart.Have you already configured -Dnetworkaddress.cache.ttl (or a related JVM DNS TTL property) in DBeaver’s vmoptions? If not, adding it and restarting DBeaver is the recommended next step; if you have, further investigation of proxy or hosts‑file settings would be needed.
Use comments to ask for clarification. Post a solution as an answer.
33,775 reputation · 01 Aug 2022, 09:01 UTC
While DBeaver itself does not expose a UI to flush the JVM DNS cache, you can influence the cache behavior globally by setting the system property networkaddress.cache.ttl (or networkaddress.cache.negative.ttl) in DBeaver’s vmoptions file. A value of 0 disables caching for successful lookups, and a negative value disables caching entirely. This change only takes effect after restarting DBeaver, and it applies to all connections launched from that JVM instance.
Regarding hostname verification, the per‑connection truststore does not alter the verification algorithm. If your JDBC driver supports it, you can override the verifier for a single connection by adding a driver‑specific property such as ssl.hostnameVerifier=AllowAll (PostgreSQL) or jsse.enableSNIExtension=false (MySQL) in the connection’s advanced settings. Drivers that do not honor such properties will continue to use the JVM‑wide EndpointIdentificationAlgorithm setting, meaning any change to verification still requires a new connection or a JVM restart.