From ffc37066304097842e104d046296af0a3e06b7e0 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 21 Jan 2022 01:18:47 +0000 Subject: [PATCH] Add SSL connection option for Redis --- src/main/java/me/william278/huskhomes2/config/Settings.java | 4 ++++ .../huskhomes2/data/message/redis/RedisReceiver.java | 6 ++++-- src/main/resources/config.yml | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/william278/huskhomes2/config/Settings.java b/src/main/java/me/william278/huskhomes2/config/Settings.java index bc4d8302..500352eb 100644 --- a/src/main/java/me/william278/huskhomes2/config/Settings.java +++ b/src/main/java/me/william278/huskhomes2/config/Settings.java @@ -51,6 +51,7 @@ public class Settings { private int redisPort; private String redisHost; private String redisPassword; + private boolean redisSSL; // Map plugin integration settings private boolean doMapIntegration; @@ -173,6 +174,7 @@ public class Settings { this.redisHost = config.getString("bungee_options.redis_credentials.host", "localhost"); this.redisPort = config.getInt("bungee_options.redis_credentials.port", 6379); this.redisPassword = config.getString("bungee_options.redis_credentials.password", ""); + this.redisSSL = config.getBoolean("bungee_options.redis_credentials.use_ssl", false); this.doMapIntegration = config.getBoolean("map_integration.enabled", false); this.mapPlugin = config.getString("map_integration.plugin", "dynmap"); @@ -509,6 +511,8 @@ public class Settings { return redisPassword; } + public boolean getRedisSSL() { return redisSSL; } + public boolean getDoBackCommand() { return doBackCommand; } public int getHikariMaximumPoolSize() { diff --git a/src/main/java/me/william278/huskhomes2/data/message/redis/RedisReceiver.java b/src/main/java/me/william278/huskhomes2/data/message/redis/RedisReceiver.java index faca3e50..80e79acc 100644 --- a/src/main/java/me/william278/huskhomes2/data/message/redis/RedisReceiver.java +++ b/src/main/java/me/william278/huskhomes2/data/message/redis/RedisReceiver.java @@ -27,13 +27,15 @@ public class RedisReceiver { jedisPool = new JedisPool(new JedisPoolConfig(), HuskHomes.getSettings().getRedisHost(), HuskHomes.getSettings().getRedisPort(), - 0); + 0, + HuskHomes.getSettings().getRedisSSL()); } else { jedisPool = new JedisPool(new JedisPoolConfig(), HuskHomes.getSettings().getRedisHost(), HuskHomes.getSettings().getRedisPort(), 0, - HuskHomes.getSettings().getRedisPassword()); + HuskHomes.getSettings().getRedisPassword(), + HuskHomes.getSettings().getRedisSSL()); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index bca2271a..3bd1b263 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -55,6 +55,7 @@ bungee_options: host: localhost port: 6379 password: '' + use_ssl: false tab_complete_cross_server: enabled: true delay: 60