Fix ssl connections on PooledConnections

useSSL in configloader wasn't passing it to the ConnectionProvider
This commit is contained in:
mohammed jasem alaajel 2022-11-05 15:44:51 +04:00
parent 5e3ce725de
commit 748bc13568
No known key found for this signature in database
1 changed files with 1 additions and 6 deletions

View File

@ -39,11 +39,6 @@ public interface ConfigLoader {
loadConfig(plugin, dataFolder.toPath());
}
// There currently a problem with the SSL/TLS connections
// looking into the Jedis source code you can pass some form of
// Domain Validation, SSL factory from javax packages
// todo: create Domain valdiation
// todo: add new config options for ssl certs locations
default void loadConfig(RedisBungeePlugin<?> plugin, Path dataFolder) throws IOException {
Path configFile = createConfigFile(dataFolder);
final YAMLConfigurationLoader yamlConfigurationFileLoader = YAMLConfigurationLoader.builder().setPath(configFile).build();
@ -126,7 +121,7 @@ public interface ConfigLoader {
GenericObjectPoolConfig<Connection> poolConfig = new GenericObjectPoolConfig<>();
poolConfig.setMaxTotal(maxConnections);
poolConfig.setBlockWhenExhausted(true);
summoner = new JedisPooledSummoner(new PooledConnectionProvider(new ConnectionFactory(new HostAndPort(redisServer, redisPort), DefaultJedisClientConfig.builder().timeoutMillis(5000).password(redisPassword).build()), poolConfig), jedisPool);
summoner = new JedisPooledSummoner(new PooledConnectionProvider(new ConnectionFactory(new HostAndPort(redisServer, redisPort), DefaultJedisClientConfig.builder().timeoutMillis(5000).ssl(useSSL).password(redisPassword).build()), poolConfig), jedisPool);
redisBungeeMode = RedisBungeeMode.SINGLE;
}
plugin.logInfo("Successfully connected to Redis.");