[英]unable to find valid certification path to requested target - link to github
A spring mvc app use mvc when I run the config-server, and try to go to the target (github link) with browser address: HTTP://localhost:8888/servise-a/master in the browser I get 404 error,- Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. A spring mvc app use mvc when I run the config-server, and try to go to the target (github link) with browser address: HTTP://localhost:8888/servise-a/master in the browser I get 404 error, - Whitelabel 错误页面 此应用程序没有显式映射 /error,因此您将其视为后备。
Thu Jan 20 10:38:56 IST 2022 There was an unexpected error (type=Not Found, status=404). Thu Jan 20 10:38:56 IST 2022 出现意外错误(类型=未找到,状态=404)。
and in the consul there are errors-在领事中有错误-
org.eclipse.jgit.api.errors.TransportException: https://github.com/ronykeren/cloud: Secure connection to https://github.com/ronykeren/cloud could not be stablished because of SSL problems
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:254) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:306) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:200) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
...
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/ronykeren/cloud: Secure connection to https://github.com/ronykeren/cloud could not be stablished because of SSL problems
at org.eclipse.jgit.transport.TransportHttp.handleSslFailure(TransportHttp.java:632) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:583) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:362) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:137) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:123) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1271) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:243) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
... 78 common frames omitted
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...
the program is very simple, the main app included just the start with spring application:该程序非常简单,主应用程序包括刚刚开始的 spring 应用程序:
package main;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
import org.springframework.context.ApplicationContext;
@EnableConfigServer
@SpringBootApplication
public class ConfigureServerApp {
public static void main(String[] args) {
SpringApplication.run(ConfigureServerApp.class);
}
}
the configuration with application.yml file: application.yml 文件的配置:
spring:
cloud:
config:
server:
git:
uri: https://github.com/ronykeren/cloud
server:
port: 8888
and pom.xml file:和 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>config-server</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version>
</parent>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<spring-cloud.version>Hoxton.SR8</spring-cloud.version>
</properties>
<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>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
</dependencies>
</project>
I think the stacktrace is quite explicite:我认为堆栈跟踪非常明确:
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/ronykeren/cloud : Secure connection to https://github.com/ronykeren/cloud could not be stablished because of SSL problems
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/ronykeren/cloud : Secure connection to https://github.com/ronykeren/cloud could not be stablished because of SSL problems
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
原因:javax.net.ssl.SSLHandshakeException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径
In fact, the config server will try to contact your Git repo but is not able to do it because the lack of a valid certificate in your JVM.实际上,配置服务器会尝试联系您的 Git 存储库,但由于 JVM 中缺少有效证书而无法联系。 I think the answer here: "PKIX path building failed" and "unable to find valid certification path to requested target" is adapted for your problem.
我认为这里的答案: “PKIX 路径构建失败”和“无法找到请求目标的有效认证路径”适合您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.