From 21cc6af91980b7ebc4de9f2ac1b5f09c5b8748d9 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Tue, 6 Oct 2020 23:15:39 +0200 Subject: Try to avoid the dreaded error "The hostname localhost could not be verified by hostnameverifier PgjdbcHostnameVerifier". --- org/madore/damlengine/WeblogDatabaseConnection.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org/madore/damlengine/WeblogDatabaseConnection.java b/org/madore/damlengine/WeblogDatabaseConnection.java index 1a1828d..b3e2690 100644 --- a/org/madore/damlengine/WeblogDatabaseConnection.java +++ b/org/madore/damlengine/WeblogDatabaseConnection.java @@ -105,6 +105,7 @@ public final class WeblogDatabaseConnection { dbProps.setProperty("user", dbUser); dbProps.setProperty("password", dbPass); dbProps.setProperty("ssl", "true"); + dbProps.setProperty("sslmode", "prefer"); dbProps.setProperty("sslfactory", "org.postgresql.ssl.NonValidatingFactory"); conn = (new Driver()).connect(dbUrl, dbProps); conn.createStatement().execute("SET TIME ZONE 0"); -- cgit v1.2.3