leiningen:如何关闭 ssl 验证?

Eri*_*ric 3 ssl clojure leiningen

我是 Windows 上的第一次 leiningen 用户。当我运行时lein run,出现以下错误:

C:\Users\me\clojure-app>lein run
Could not transfer artifact org.clojure:clojure:pom:1.7.0 from/to central (https://repo1.maven.org/maven2/): 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 org.clojure:tools.nrepl:pom:0.2.10 from/to central (https://repo1.maven.org/maven2/): 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 clojure-complete:clojure-complete:pom:0.2.3 from/to central (https://repo1.maven.org/maven2/): 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 or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Run Code Online (Sandbox Code Playgroud)

我http_proxy和https_proxy环境变量确实设置正确。

我在使用自己的 SSL 证书重新签署网络流量的公司防火墙后面,我怀疑这可能是我问题的根源。但是,我将HTTP_CLIENT环境变量设置为:

curl --insecure -f -L -o
Run Code Online (Sandbox Code Playgroud)

...避免 SSL 验证(如安装帮助中的此注释所建议),但这并没有改变错误消息。

因此,我想我的根本问题是:用户必须采取哪些步骤才能lein run成功降低对位于重新签署 SSL 流量的公司防火墙后面的 Windows 机器的依赖?:o)

Art*_*ldt 5

以下是一些与疯狂程度相反的选项(最不疯狂)

  • 将您的公司代理添加到您的信任存储中,并且不要在莱宁根做任何您下次更改项目或计算机时必须记住的特殊事情。除了系统之外,您可能还需要将其添加到 Java JVM 的证书存储中(这很可能是您的问题)
  • 将您公司的代理证书添加到项目的project.clj 的 :certificate 部分这样,如果证书需要更改,则只需一个人更改它,整个团队都将受益。
  • 许多公司都有一个内部缓存 maven 代理,比如Nexus,它会自动获取和缓存依赖项,然后让它们快速提供给网络内部的人。通过四处询问或查看 Java 项目的 .pom 文件中的配置,找出您是否拥有其中之一。
  • 回家,或去当地的咖啡店,下载依赖项,然后再回到办公室。无论如何,在处理了 TLS 证书之后,散步和呼吸新鲜空气总是好的。
  • 使用浏览器手动下载文件,然后自己将它们放在 .m2 目录中。

通过省略对您的实际问题的回答,我真的不想傲慢自大。我确实意识到没有选项可以禁用此列表中的安全性。这是故意的,因为其中一个选项肯定会起作用,并且知道如何使用这些选项会使您的生活变得更好。如果它仍然让人觉得自命不凡,那么请接受我最诚挚的道歉和答案。