【问题标题】:Spring-boot Actuator SSL configurationSpring-boot 执行器 SSL 配置
【发布时间】:2015-06-26 11:44:13
【问题描述】:

我正在使用嵌入式 tomcat 开发一个带有 Spring-boot 的 web 应用程序。 此应用的要求之一是 2-way SSL (clientAuth)。

启用 ClientAuth 很简单,但是我们也喜欢使用 spring-boot Actuator 来管理没有 clientAuth 的不同端口上的应用程序。

有没有一种干净的方法可以做到这一点?

(在执行器端点上禁用 SSL 也足够了)

【问题讨论】:

  • 查看org.springframework.boot.actuate.autoconfigure.EndpointWebMvcChildContextConfiguration 的源代码,我看到ServerProperties 是从beanFactory 注入的,但是我的Spring 经验太有限,无法弄清楚我如何/如果我能影响这个实际注入的是哪个bean在那里,或者我如何获得 bean 来配置它。
  • 自从我问这个问题以来,一定是在更新 Spring Boot,谢谢。 (如果您愿意,可以将其作为答案)

标签: spring-boot embedded-tomcat-8 spring-boot-actuator


【解决方案1】:

根据最新的spring docs,你可以使用

management.server.port=8080
management.server.ssl.enabled=false

在属性中配置管理端口。有关更多选项,请参阅 Spring Boot 文档中的 production-ready-management-specific-ssl

【讨论】:

  • 为什么不使用不同的端口就不能做同样的事情?
  • @PatPatPat 使用不同的端口允许您将管理 web 应用程序与主 web 应用程序分开。如果您想使用相同的端口,您需要为您的应用程序全局启用/禁用 SSL
猜你喜欢
  • 2019-01-01
  • 2019-05-02
  • 2014-04-07
  • 2018-09-07
  • 2022-11-17
  • 2018-10-07
  • 1970-01-01
  • 2016-02-13
  • 2021-04-07
相关资源
最近更新 更多