spring-data-redis
spring-data-redis copied to clipboard
Failed to get connection from GCP hyper scaler Redis env
The redis server configuration looks like:
"password": "aaaaaaaa", "hostname": "10.*.64.20", "port": 6378, "uri": "rediss://:aaaaaaa@10.*.64.20:6378", "cluster_mode": false, "tls": { "server_ca": "-----BEGIN CERTIFICATE-----\nMIIDnTCCAoWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBhTEtMCsGA1UELhMkN2Y1\nYjhhMDYtZGVkZi00NWZjLTkxN2YtNThlOTA0ZDhjZTMzMTEwLwYDVQQDEyhHb29n\nbGUgQ2xvdWQgTWVtb3J5c3RvcmUgUmVkaXMgU2VydmVyIENBMRQwEgYDVQQKEwtH**** }
I just used the spring redis 2.7.*
JedisConnectionFactory jedisConFactory = new JedisConnectionFactory(poolocnfig);
jedisConFactory.setUseSsl(true);
jedisConFactory.setHostName(hostName);
jedisConFactory.setPort(6378);
jedisConFactory.setPassword(****);
Finally, it still failed to get the connection.
The same code can work on other env like (azure, aws) hyperscaler option. Because in their env,
the tls is simple with value "true".
I just worry the part of "tls" , server_ca, I failed to find any code to set it.
Anybody can help?
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal sample that reproduces the problem. A stack trace along with the error message would be helpful.
The call stack looks like this: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at :10.160.64.20org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool","stacktrace":["org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool","\tat org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:292)","\tat
Here, I just assume that the "server_ca" is the key part. Perhaps Redis client library need some convinient support when the provided truststore is a PEM certificate in TLS connection mode? I can't find any sample on how to use it.
Can you please include the full stack trace and the outermost exception message? The details above show only an excerpt.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.