'Unable to connect to GCP Redis with SSL enabled. Is there any way to pass .Pem Certifcate in spring configs?
currently this is how I am connecting with redis..If someone can let me know how to configure ssl options to use .pem certificate will be very useful
@Bean
LettuceConnectionFactory redisConnectionFactory() {
final SocketOptions socketOptions = SocketOptions.builder()
.keepAlive(true).build();
final ClientOptions clientOptions = ClientOptions.builder()
.socketOptions(socketOptions).build();
LettuceClientConfiguration clientConfig = redisUtil.isSslEnable()? LettuceClientConfiguration.builder()
.clientOptions(clientOptions).useSsl().build():LettuceClientConfiguration.builder()
.clientOptions(clientOptions).build();
RedisStandaloneConfiguration serverConfig = new RedisStandaloneConfiguration(redisUtil.getHost(),
redisUtil.getPort());
serverConfig.setPassword(redisUtil.getKey());
return new LettuceConnectionFactory(serverConfig, clientConfig);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
