diff options
author | David A. Madore <david+git@madore.org> | 2020-10-06 23:15:39 +0200 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2020-10-06 23:15:39 +0200 |
commit | 21cc6af91980b7ebc4de9f2ac1b5f09c5b8748d9 (patch) | |
tree | 01c7f79557320e4b03e25eb3193037756f5c1829 | |
parent | c158cbae2d8da447523c7c0648ac5585abd0d6c0 (diff) | |
download | damlengine-21cc6af91980b7ebc4de9f2ac1b5f09c5b8748d9.tar.gz damlengine-21cc6af91980b7ebc4de9f2ac1b5f09c5b8748d9.tar.bz2 damlengine-21cc6af91980b7ebc4de9f2ac1b5f09c5b8748d9.zip |
Try to avoid the dreaded error "The hostname localhost could not be verified by hostnameverifier PgjdbcHostnameVerifier".
-rw-r--r-- | org/madore/damlengine/WeblogDatabaseConnection.java | 1 |
1 files changed, 1 insertions, 0 deletions
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"); |