Java 从URL获取数据时PKIX路径生成失败

Java 从URL获取数据时PKIX路径生成失败,java,ssl,ssl-certificate,Java,Ssl,Ssl Certificate,我试图获得如下数据(由API指示): 我还尝试通过keytool导入证书,但收到一条消息说“文件密钥库不存在” 有人可以支持我吗?提前感谢5秒的浏览器为我提供了所有这些信息: Your connection is not secure The owner of opendata.aemet.es has configured their web site improperly. To protect your information from being stolen, Firefox has

我试图获得如下数据(由API指示):

我还尝试通过keytool导入证书,但收到一条消息说“文件密钥库不存在”


有人可以支持我吗?提前感谢

5秒的浏览器为我提供了所有这些信息:

Your connection is not secure

The owner of opendata.aemet.es has configured their web site improperly. To protect your information from being stolen, Firefox has not connected to this web site.

Learn more…

Report errors like this to help Mozilla identify and block malicious sites

opendata.aemet.es uses an invalid security certificate.

The certificate is not trusted because the issuer certificate is unknown.
The server might not be sending the appropriate intermediate certificates.
An additional root certificate may need to be imported.

Error code: SEC_ERROR_UNKNOWN_ISSUER

我使用的unirest版本是3.1.02, maven配置为:

<dependency>
   <groupId>com.konghq</groupId>
   <artifactId>unirest-java</artifactId>
   <version>3.1.02</version>
   <classifier>standalone</classifier>
</dependency>

com.konghq
unirest java
3.1.02
独立的
我看到
kong.unirest.UnirestException:javax.net.ssl.SSLHandshakeException。

当我config
Unirest.config().verifySsl(false)时它工作,异常消失

,是否有可能避免Java代码中的验证?谢谢
Your connection is not secure

The owner of opendata.aemet.es has configured their web site improperly. To protect your information from being stolen, Firefox has not connected to this web site.

Learn more…

Report errors like this to help Mozilla identify and block malicious sites

opendata.aemet.es uses an invalid security certificate.

The certificate is not trusted because the issuer certificate is unknown.
The server might not be sending the appropriate intermediate certificates.
An additional root certificate may need to be imported.

Error code: SEC_ERROR_UNKNOWN_ISSUER
<dependency>
   <groupId>com.konghq</groupId>
   <artifactId>unirest-java</artifactId>
   <version>3.1.02</version>
   <classifier>standalone</classifier>
</dependency>