Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 拱顶。春天无法识别的SSL消息,纯文本连接/_Spring_Testing_Containers_Hashicorp Vault_Spring Vault - Fatal编程技术网

Spring 拱顶。春天无法识别的SSL消息,纯文本连接/

Spring 拱顶。春天无法识别的SSL消息,纯文本连接/,spring,testing,containers,hashicorp-vault,spring-vault,Spring,Testing,Containers,Hashicorp Vault,Spring Vault,我试图在bean中运行vault容器,并使用它创建vault模板bean,以便在测试中进一步使用 @TestConfiguration @TestPropertySource("classpath:application.yml") public class TestsConfiguration { @Container public static VaultContainer vaultContainer = new VaultContainer();

我试图在bean中运行vault容器,并使用它创建vault模板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"));
    }


}
但是,当我尝试写一些操作时,我得到:

“获取请求时发生I/O错误”https://localhost:32998/v1/my/secret“:无法识别的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"));
    }


}