Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何通过redis.lettuce连接带证书的redis?(redis非集群,HA模式的) #858

Open
xianhuangxu opened this issue Feb 22, 2024 · 1 comment

Comments

@xianhuangxu
Copy link

目前只在文档示例里面看见连接没有开启ssl的redis示例,请问有没有连接开启了ssl的连接方式,且是需要指定证书路径的那种?如果不支持的话会否考虑支持这种连接方式?

@Roiocam
Copy link
Contributor

Roiocam commented Mar 19, 2024

根据 lettuce 文档:

https://lettuce.io/core/release/reference/index.html#ssl

有几种使用方式,从 JetCache 源码上看,直接用 URI 表示这是一个 SSL 链接即可,例如

jetcache: 
  remote:
    default:
      type: redis.lettuce
-     uri: redis://127.0.0.1:6379/
+     uri: rediss://127.0.0.1:6379/

List<RedisURI> uriList = map.values().stream().map((k) -> RedisURI.create(URI.create(k.toString())))
.collect(Collectors.toList());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants