unable to find valid certification path to requested target
时间: 2023-08-26 19:17:52 浏览: 117
The error "unable to find valid certification path to requested target" usually occurs when a Java application is unable to establish a secure connection with a remote server due to missing or invalid SSL certificates.
To resolve this issue, you can try the following steps:
1. Update the Java Runtime Environment (JRE) to the latest version. Sometimes, older versions may have issues with SSL certificates.
2. Import the SSL certificate of the remote server into the JRE's truststore. You can use the keytool command-line tool to import the certificate. Here is an example command:
```
keytool -import -alias mycert -keystore cacerts -file <path-to-certificate-file>
```
Replace `<path-to-certificate-file>` with the actual path to the certificate file. The default password for the truststore is usually "changeit".
3. If you are running the application in an IDE, make sure that the IDE is using the same JRE and truststore that you have modified.
By following these steps, you should be able to resolve the "unable to find valid certification path to requested target" error.
阅读全文