错误 javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:使用 ssl.insecure 标志时的 PKIX 路径

Error javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path while using ssl.insecure flag

我正在使用 Maven 和 Artifactory,并希望通过 http 连接解决 pom.xml 依赖关系。因此我使用 Maven wagon 的标志 as specified here.

我想知道如果我告诉 Maven 使用不安全的 ssl 连接,为什么我仍然会收到错误消息。

根据 documentation:

maven.wagon.http.ssl.insecure = true/false (false by default), enable/disable relaxed check of public key certificates (e.g. self-signed ones). Relaxed check means that any chain with 1 or more certificates will be considered valid if all the certificate dates in the chain are valid (dates check can be overridden as well - see below).

宽松的检查并不意味着完全没有检查,它会切换到没有 tls 的 http。从我了解到的消息中,没有从服务器提供的证书到信任库中包含的任何证书的证书路径。您可能在信任库中丢失了一些相关证书。