java - lein环uberjar : PKIX path building failed?

标签 java maven ssl clojure leiningen

我无法从本地计算机运行“leinring uberjar”。我收到以下错误:

Could not find artifact ring-server:ring-server:jar:0.5.0 in central (https://repo1.maven.org/maven2/)
Could not transfer artifact ring-server:ring-server:jar:0.5.0 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Could not transfer artifact ring-server:ring-server:pom:0.5.0 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Could not transfer artifact ring:ring:pom:1.6.1 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

我认为这是 ssl 的问题,但我不知道如何解决它。有办法重置证书吗?

这就是我的 project.clj 的样子:

(defproject app
  :dependencies [
                 [org.clojure/clojure "1.10.0"]
                 [org.clojure/tools.logging "0.4.0"]
                 [org.clojure/tools.cli "0.3.5"]
                 [org.clojure/data.json "0.2.6"]
                 [clj-http "3.9.1"]
                 [clj-time "0.14.2"]
                 [mysql/mysql-connector-java "5.1.38"]
                 [org.slf4j/slf4j-log4j12 "1.7.25"]
                 [log4j/log4j "1.2.17" :exclusions [javax.mail/mail
                                                    javax.jms/jms
                                                    com.sun.jmdk/jmxtools
                                                    com.sun.jmx/jmxri]]
                 [metosin/compojure-api "1.1.11"]
                 [metosin/ring-swagger "0.26.1"]
                 [compojure "1.6.0"]
                 [cheshire "5.8.0"]
                 [ring "1.6.3"]
                 [ring/ring-json "0.4.0"]
                 [ring-logger "0.7.7"]
                 [environ "1.1.0"]
                 [korma "0.4.3"]
                 [blackwater "0.0.9"]
                 [prismatic/schema "1.1.7"]
                 [siili/humanize "0.1.1"]
                 [ring-cors "0.1.12"]
                 [commons-io "2.0"]
                 [buddy/buddy-sign "3.0.0"]
                 [byte-transforms "0.1.4"]
                 ]

  :ring {:handler app.api.handler/app}

  :source-paths ["src"]

  :resource-paths ["resources"]

  :test-paths ["test/unit"
               "test/features"]

  :profiles {:default [:local]
             :uberjar {:aot :all}
             :local   {:cucumber-feature-paths ["test/features"]
                       :plugins                [
                                                [lein-ring "0.12.1"]
                                                [com.siili/lein-cucumber "1.0.7"]
                                                [lein-cloverage "1.0.10"]
                                                [lein-kibit "0.1.6"]
                                                [lein-cloverage "1.0.10"]
                                                [lein-try "0.4.3"]
                                                [nightlight/lein-nightlight "1.0.0"]
                                                [jonase/eastwood "0.2.3"]
                                                [cider/cider-nrepl "0.16.0"]
                                                ]
                       }
             }
  )

最佳答案

我认为我的 JVM 的 CA 设置被搞乱了,我能够通过以下方式解决此问题:

  1. 通过浏览器下载丢失的 .crt 文件。
  2. 将 .crt 文件添加到 key 存储中。 keytool -import -trustcacerts -file [.crt 文件路径] -alias [别名] -keystore $JAVA_HOME/lib/security/cacerts
  3. 检查 .crt 文件是否已添加到 keystore 中 keytool -list -keystore $JAVA_HOME/lib/security/cacerts
  4. Reran lein Ring uberjar

关于java - lein环uberjar : PKIX path building failed?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60935087/

相关文章:

java - 在 Retrofit Android 中获取响应

java - Android setText 不适用于 TextView

javascript - 实现用户登录系统的正确方法

java - 同时发出 JSON 请求

java - 将库添加到 JRE

java - 如何将 Maven Artifact 放入 Jenkins Maven 存储库?

java - m2e connector buildhelper 与 Eclipse Juno SR1 m2e 1.2 不兼容

maven - 错误 SLF4J : Class path contains multiple SLF4J bindings jenkins cobertura maven

qt - QsslSocket : Cannot access peer (client) certificate on other peer (server)

ssl - RapidSSL 到 AWS 证书管理器