金库。 Spring。无法识别的 SSL 消息,明文连接/

Vault. Spring. Unrecognized SSL message, plaintext connection/

我正在尝试 运行 bean 中的 vault 容器并将其用于创建 VaultTemplate bean 以进一步在测试中使用

@TestConfiguration
@TestPropertySource("classpath:application.yml")
public class TestsConfiguration {

    @Container
    public static VaultContainer vaultContainer = new VaultContainer();


    @Bean
    @Order(1)
    public VaultEndpoint vaultEndpoint() {
        vaultContainer
                .withVaultToken("00000000-0000-0000-0000-000000000000")
                .withExposedPorts(8200);
        vaultContainer.start();
        return VaultEndpoint.create(vaultContainer.getContainerIpAddress(), vaultContainer.getMappedPort(8200));
    }

    @Bean
    @Order(2)
    public VaultTemplate vaultTemplate(VaultEndpoint vaultEndpoint) {
        return new VaultTemplate(vaultEndpoint, new TokenAuthentication("00000000-0000-0000-0000-000000000000"));
    }


}

但是,当我尝试通过 VaultOperations 写入一些 kv 时,我得到:

I/O 对“https://localhost:32998/v1/my/secret”的 GET 请求错误:无法识别的 SSL 消息,纯文本连接?;嵌套异常是 javax.net.ssl.SSLException:无法识别的 SSL 消息,纯文本连接?

我该如何解决这个问题?

@TestConfiguration
@TestPropertySource("classpath:application.yml")
public class TestsConfiguration {

    @Container
    public static VaultContainer vaultContainer = new VaultContainer();


    @Bean
    public VaultEndpoint vaultEndpoint() {
        vaultContainer
                .withVaultToken("00000000-0000-0000-0000-000000000000")
                .withExposedPorts(8200);
        vaultContainer.start();
        return VaultEndpoint.create(vaultContainer.getContainerIpAddress(), vaultContainer.getMappedPort(8200));
    }

    @Bean
    public VaultTemplate vaultTemplate(VaultEndpoint vaultEndpoint) {
    vaultEndpoint.setScheme("http"); ////////////// this
    return new VaultTemplate(vaultEndpoint, new TokenAuthentication("00000000-0000-0000-0000-000000000000"));
    }


}