gpt4 book ai didi

maven-3 - maven package command return extension (5) 不应出现在 certificate_request 中

转载 作者:行者123 更新时间:2023-12-05 06:14:32 28 4
gpt4 key购买 nike

我在 spring 项目中使用了 vault 服务器,当我想用​​ maven 创建一个 jar 文件时,我遇到了这个错误。

 .   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.1.RELEASE)

2020-07-11 12:49:59.901 WARN 33652 --- [ main] o.s.v.a.LifecycleAwareSessionManager : Cannot enhance VaultToken to a LoginToken: Token self-lookup failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://development:8200/v1/auth/token/lookup-self": extension (5) should not be presented in certificate_request; nested exception is javax.net.ssl.SSLHandshakeException: extension (5) should not be presented in certificate_request
2020-07-11 12:49:59.955 WARN 33652 --- [ main] LeaseEventPublisher$LoggingErrorListener : [RequestedSecret [path='secret/inquiry/dev', mode=ROTATE]] Lease [leaseId='null', leaseDuration=PT0S, renewable=false] I/O error on GET request for "https://development:8200/v1/secret/inquiry/dev": extension (5) should not be presented in certificate_request; nested exception is javax.net.ssl.SSLHandshakeException: extension (5) should not be presented in certificate_request

org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://development:8200/v1/secret/inquiry/dev": extension (5) should not be presented in certificate_request; nested exception is javax.net.ssl.SSLHandshakeException: extension (5) should not be presented in certificate_request
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:748) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:674) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:315) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.vault.core.VaultTemplate.lambda$doRead$5(VaultTemplate.java:401) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.vault.core.VaultTemplate.doWithSession(VaultTemplate.java:388) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.vault.core.VaultTemplate.doRead(VaultTemplate.java:398) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.vault.core.VaultTemplate.read(VaultTemplate.java:290) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.vault.core.lease.SecretLeaseContainer.doGetSecrets(SecretLeaseContainer.java:662) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.vault.core.lease.SecretLeaseContainer.start(SecretLeaseContainer.java:396) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.vault.core.lease.SecretLeaseContainer.addRequestedSecret(SecretLeaseContainer.java:355) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.vault.core.env.LeaseAwareVaultPropertySource.loadProperties(LeaseAwareVaultPropertySource.java:184) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.vault.core.env.LeaseAwareVaultPropertySource.<init>(LeaseAwareVaultPropertySource.java:169) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.vault.core.env.LeaseAwareVaultPropertySource.<init>(LeaseAwareVaultPropertySource.java:122) ~[spring-vault-core-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.cloud.vault.config.LeasingVaultPropertySourceLocator.createVaultPropertySource(LeasingVaultPropertySourceLocator.java:157) ~[spring-cloud-vault-config-2.2.3.RELEASE.jar:2.2.3.RELEASE]

我在网上搜索了一下,发现 Java 11 中存在一些错误,但我使用的是 Java 14。当我添加 -Djdk.tls.client.protocols=TLSv1.2 我的 pom 文件的选项,异常没有变化这是我的 pom.xml 文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
<relativePath/>
</parent>
<groupId>ir.co.isc.sepam</groupId>
<artifactId>inquiry</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>inquiry</name </description>

<properties>
<java.version>14</java.version>
<maven.compiler.source>14</maven.compiler.source>
<maven.compiler.target>14</maven.compiler.target>
<spring-cloud.version>Hoxton.SR6</spring-cloud.version>
<!--<jvm.options>-Dmaven.wagon.http.ssl.insecure=true</jvm.options>-->
<!--<jvm.options>-Djdk.tls.client.protocols=TLSv1.2</jvm.options>-->
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-vault-config</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- <configuration>
<jvmArguments>${jvm.options}</jvmArguments>
</configuration>-->
</plugin>
</plugins>
</build>

</project>

最佳答案

默认的 vault server -dev(开发人员)设置不使用 HTTPS,因此您需要配置 Vault 端点以指向正确的 URI,或者读取 VAULT_ADDR 环境变量,因为 spring-vault 似乎没有使用它。

    @Override
public VaultEndpoint vaultEndpoint() {
return VaultEndpoint.from(URI.create("http://localhost:8200/v1"));
}

对于 KV 版本 2,您还需要使用不同的路径 (/data/)。

vault kv put secret/secret1 lanId=password
vault kv put secret/secret2 lanId=password

... 由 /v1/secret/data/secret1/v1/secret/data/secret2 访问。

VaultResponse response = operations.read("secret/data/secret1");
if (response == null) {
...
}

关于maven-3 - maven package command return extension (5) 不应出现在 certificate_request 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62847013/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com