SslBundle integration with FeignClients
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- java, spring-boot
调研方向
从 Feign 客户端配置入口开始,比较所示的 SslBundles/SSLContext 方案与 RestTemplateBuilder.setSslBundle。跟踪 Feign 客户端如何构建其 Client,并确定可以在哪里选择 SSL bundle。完成标准是 FeignClients 可以使用已配置的 Spring Boot SSL bundle,并且行为和失败处理都有测试覆盖。
由索引模型根据 Issue 内容生成。
描述
Recently, in spring-boot 3.1, spring team introduced the SslBundles component as a convenient way to configure SSL connection to RestTemplate and RestClient.
As reference: https://spring.io/blog/2023/06/07/securing-spring-boot-applications-with-ssl
I similar approach would be interesting to exist in the spring-cloud-openfeign.
I am currently taking the following approach:
application.yml
spring:
ssl:
bundle:
jks:
secure-service:
key:
alias: "secure-service"
keystore:
location: "classpath:keystore.p12"
password: "myStrongPassword"
type: "PKCS12"
@Bean
@ConditionalOnProperty(prefix = "spring.ssl.bundle.jks.secure-service.key", name = "alias")
public Client feignClient(SslBundles sslBundles) throws Exception {
// "secure-service" is defined in application properties
try {
SslBundle sslBundle = sslBundles.getBundle("secure-service");
SSLContext sslContext = sslBundle.createSslContext();
log.info("Configuring SSL Context for FeignClient");
return new Client.Default(sslContext.getSocketFactory(), new DefaultHostnameVerifier());
} catch (NoSuchSslBundleException ex) {
log.error("SSLContext not provided. Creating FeignClient without sslContext.");
throw new IllegalStateException("spring.ssl.bundle.jks.secure-service.key.alias not configure correctly. Please change your application properties, yml or environment configuration.");
}
}
I proposed approach would be similar to this:
@Bean
public restTemplate(RestTemplateBuilder restTemplateBuilder, SslBundles sslBundles) {
this.restTemplate = restTemplateBuilder.setSslBundle(sslBundles.getBundle("secure-service")).build();
}
Further reference: https://www.baeldung.com/spring-boot-security-ssl-bundles
- 主要语言
- Java
- 星标
- 1.3k
- 派生
- 834
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 14
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
spring-cloud/spring-cloud-openfeign 的其他 Issue
-
waiting-for-triage
难度 4/5 3-5 天 新手友好度 22/100
spring-cloud/spring-cloud-openfeign#1452 · 1 条评论 ·
维护者通常 1 天内回复
-
question
难度 4/5 3-5 天 新手友好度 35/100
spring-cloud/spring-cloud-openfeign#1392 · 1 条评论 ·
维护者通常 1 天内回复
-
FeignClientsConfiguration$MicrometerConfiguration.class cannot be opened because it does not exist未关闭feedback-provided
难度 4/5 3-5 天 新手友好度 35/100
spring-cloud/spring-cloud-openfeign#1379 · 5 条评论 ·
维护者通常 1 天内回复
-
waiting-for-triage
难度 3/5 1-2 天 新手友好度 57/100
spring-cloud/spring-cloud-openfeign#1344 · 2 条评论 ·
维护者通常 1 天内回复
-
waiting-for-triage
难度 4/5 3-5 天 新手友好度 45/100
spring-cloud/spring-cloud-openfeign#1343 ·
维护者通常 1 天内回复
查看 spring-cloud/spring-cloud-openfeign 的全部 Issue
相似的 Issue
-
bug main ui
难度 2/5 1-3 小时 新手友好度 78/100
openhab/openhab-webui#4671 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 64/100
NearVanilla/IceCream#109 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
omatheusmesmo/vintelli#293 ·
维护者通常 1 天内回复
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3未关闭
难度 1/5 1-3 小时 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 82/100
bancolombia/bin-stash#79 ·