From 0edf160f4351bb348133c292d1e5f371ff3caba9 Mon Sep 17 00:00:00 2001 From: Intelli Date: Wed, 23 Aug 2023 16:31:40 -0600 Subject: [PATCH] Added hidden "enable-ssl" database option (default: false) --- src/main/java/net/coreprotect/config/Config.java | 2 ++ src/main/java/net/coreprotect/config/ConfigHandler.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/coreprotect/config/Config.java b/src/main/java/net/coreprotect/config/Config.java index 6ec4405..bae4f16 100644 --- a/src/main/java/net/coreprotect/config/Config.java +++ b/src/main/java/net/coreprotect/config/Config.java @@ -43,6 +43,7 @@ public class Config extends Language { public String MYSQL_PASSWORD; public String LANGUAGE; public boolean ENABLE_AWE; + public boolean ENABLE_SSL; public boolean DISABLE_WAL; public boolean HOVER_EVENTS; public boolean DATABASE_LOCK; @@ -190,6 +191,7 @@ public class Config extends Language { private void readValues() { this.ENABLE_AWE = this.getBoolean("enable-awe", false); + this.ENABLE_SSL = this.getBoolean("enable-ssl", false); this.DISABLE_WAL = this.getBoolean("disable-wal", false); this.HOVER_EVENTS = this.getBoolean("hover-events", true); this.DATABASE_LOCK = this.getBoolean("database-lock", true); diff --git a/src/main/java/net/coreprotect/config/ConfigHandler.java b/src/main/java/net/coreprotect/config/ConfigHandler.java index cdd6653..a1cd7f7 100644 --- a/src/main/java/net/coreprotect/config/ConfigHandler.java +++ b/src/main/java/net/coreprotect/config/ConfigHandler.java @@ -249,7 +249,7 @@ public class ConfigHandler extends Queue { config.addDataSourceProperty("maintainTimeStats", "false"); /* Disable SSL to suppress the unverified server identity warning */ config.addDataSourceProperty("allowPublicKeyRetrieval", "true"); - config.addDataSourceProperty("useSSL", "false"); + config.addDataSourceProperty("useSSL", Config.getGlobal().ENABLE_SSL); ConfigHandler.hikariDataSource = new HikariDataSource(config); }