Spring boot Spring Boot,Hawtio/Jolokia未连接自签名证书

Spring boot Spring Boot,Hawtio/Jolokia未连接自签名证书,spring-boot,spring-boot-actuator,Spring Boot,Spring Boot Actuator,我想在我的Spring Boot应用程序中测试连接到hawtio/jolokia以查看一些jwm参数,但我想在我的Spring Boot应用程序上使用自签名证书 首先: 当我包含自签名证书时,我无法从hawtio连接到Jolokia客户端 即在https://localhost:8089/hawtio/jvm/connect 当我尝试将连接添加到https://localhost:8089/hawtio/jolokia “测试连接”我得到一个小的橙色警告三角形,表示“连接失败” 我可以用两种方法

我想在我的Spring Boot应用程序中测试连接到hawtio/jolokia以查看一些jwm参数,但我想在我的Spring Boot应用程序上使用自签名证书

首先: 当我包含自签名证书时,我无法从hawtio连接到Jolokia客户端

即在https://localhost:8089/hawtio/jvm/connect 当我尝试将连接添加到https://localhost:8089/hawtio/jolokia “测试连接”我得到一个小的橙色警告三角形,表示“连接失败”

我可以用两种方法解决这个问题

  • 使用适当的CA颁发的证书(即非自签名)
  • 运行我的测试应用程序时,将-Dhawtio.proxyDisableCertificateValidation=true作为参数添加
  • 下一步: 一旦我绕过了SSL位,我尝试连接到Jolokia客户端,结果只被要求输入用户名/密码

    经过一番研究,我发现我可以做两件事:

  • 运行我的测试应用程序时,Add-Dhawtio.authenticationEnabled=false作为参数
  • 将hawtio.authenticationEnabled=false添加到application.properties文件中
  • 我的问题 为什么我不能像使用hawtio.authenticationEnabled=false一样,将hawtio.proxyDisableCertificateValidation=true放在应用程序属性文件中。我显然希望将所有这些配置都保存在application.properties文件中

    我在pom.xml文件中使用以下依赖项:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>io.hawt</groupId>
        <artifactId>hawtio-springboot</artifactId>
        <version>2.13.2</version>
    </dependency> 
    <dependency>
        <groupId>io.hawt</groupId>
        <artifactId>hawtio-core</artifactId>
        <version>2.13.2</version>
    </dependency>
    
    #===============================================================================
    # Management and Health check settings
    # If you are using a self-signed certificate you need to run the API with the 
    # following parameter: -Dhawtio.proxyDisableCertificateValidation=true
    #===============================================================================
    management.server.port=8089
    management.endpoints.web.base-path=/
    management.endpoint.health.show-details=always
    management.endpoints.web.exposure.include=*,hawtio
    management.endpoint.beans.enabled=true
    hawtio.authenticationEnabled=false