Add SSL connection option for Redis

This commit is contained in:
William committed 2022-01-21 01:18:47 +00:00
1 parent 68daea3ce9
commit ffc3706630
3 files changed
+9 -2

No files matched your search

@@ -51,6 +51,7 @@ public class Settings {
private int redisPort; private int redisPort;
private String redisHost; private String redisHost;
private String redisPassword; private String redisPassword;
private boolean redisSSL;
// Map plugin integration settings // Map plugin integration settings
private boolean doMapIntegration; private boolean doMapIntegration;
@@ -173,6 +174,7 @@ public class Settings {
this.redisHost = config.getString("bungee_options.redis_credentials.host", "localhost"); this.redisHost = config.getString("bungee_options.redis_credentials.host", "localhost");
this.redisPort = config.getInt("bungee_options.redis_credentials.port", 6379); this.redisPort = config.getInt("bungee_options.redis_credentials.port", 6379);
this.redisPassword = config.getString("bungee_options.redis_credentials.password", ""); 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.doMapIntegration = config.getBoolean("map_integration.enabled", false);
this.mapPlugin = config.getString("map_integration.plugin", "dynmap"); this.mapPlugin = config.getString("map_integration.plugin", "dynmap");
@@ -509,6 +511,8 @@ public class Settings {
return redisPassword; return redisPassword;
} }
public boolean getRedisSSL() { return redisSSL; }
public boolean getDoBackCommand() { return doBackCommand; } public boolean getDoBackCommand() { return doBackCommand; }
public int getHikariMaximumPoolSize() { public int getHikariMaximumPoolSize() {
@@ -27,13 +27,15 @@ public class RedisReceiver {
jedisPool = new JedisPool(new JedisPoolConfig(), jedisPool = new JedisPool(new JedisPoolConfig(),
HuskHomes.getSettings().getRedisHost(), HuskHomes.getSettings().getRedisHost(),
HuskHomes.getSettings().getRedisPort(), HuskHomes.getSettings().getRedisPort(),
0); 0,
HuskHomes.getSettings().getRedisSSL());
} else { } else {
jedisPool = new JedisPool(new JedisPoolConfig(), jedisPool = new JedisPool(new JedisPoolConfig(),
HuskHomes.getSettings().getRedisHost(), HuskHomes.getSettings().getRedisHost(),
HuskHomes.getSettings().getRedisPort(), HuskHomes.getSettings().getRedisPort(),
0, 0,
HuskHomes.getSettings().getRedisPassword()); HuskHomes.getSettings().getRedisPassword(),
HuskHomes.getSettings().getRedisSSL());
} }
} }
+1
View File
@@ -55,6 +55,7 @@ bungee_options:
host: localhost host: localhost
port: 6379 port: 6379
password: '' password: ''
use_ssl: false
tab_complete_cross_server: tab_complete_cross_server:
enabled: true enabled: true
delay: 60 delay: 60