clojure - 在防火墙后面的 Windows 10 上安装 leiningen-win-installer 1.0 时遇到问题

标签 clojure

我在 Windows 10 工作计算机上安装和配置 Leiningen 时遇到问题。我假设我公司的防火墙阻止 GitHub 安全证书进行身份验证。

我收到的错误是:

Exception calling "DownloadFile" with "2" argument(s): "The request was aborted: Could not create SSL/TLS secure channel." At line:1 char:145 + ... che]::DefaultNetworkCredentials; $client.DownloadFile($a, $f)} "https ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : WebException

Failed to download https://github.com/technomancy/leiningen/releases/download/2.8.1/leiningen-2.8.1-standalone.zip

有可能是由于“powershell”导致下载失败, “curl”或“wget”无法检索 GitHub 的安全证书。 以下建议不检查证书,因此仅在以下情况下使用此建议: 您了解不这样做的安全影响。

PowerShell 无法下载最新的 Leiningen 版本。 尝试通过设置使用“curl”或“wget”下载Leiningen HTTP_CLIENT 环境变量具有以下之一 值:

  • 设置 HTTP_CLIENT=wget --no-check-certificate -O
  • 设置 HTTP_CLIENT=curl -f -L -k -o

注意:设置值时请确保添加双引号 HTTP_CLIENT 的

最佳答案

Github 仅支持 TSL 1.2。默认情况下,PowerShell 不支持此协议(protocol)。

要向每个 PowerShell session 添加 TSL 1.2 支持,您需要编辑 PowerShell 配置文件:Microsoft.PowerShell_profile.ps1

配置文件路径(Windows 10):

C:\Users\%USERNAME%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

将此行添加到配置文件中:

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

添加此行后,请使用“lein self-install”重试。至少这对我有用,记得添加 PATH 变量。

有关如何添加 PATH 变量的快速教程:

  1. 打开文件资源管理器
  2. 右键单击此电脑
  3. 选择属性
  4. 在新窗口的左侧选择“高级系统设置”
  5. 在此屏幕底部选择环境变量...
  6. 查找 PATH 变量
  7. ;C\Lein\;(lein.bat 所在文件夹的路径)附加到现有 PATH 变量

如果一切正常,你应该有类似的答案:

CMD working lein

关于clojure - 在防火墙后面的 Windows 10 上安装 leiningen-win-installer 1.0 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49183604/

相关文章:

clojure - 是否可以分解 Clojure 函数?

c# - Clojure CLR 中的 UDP 套接字代码

clojure - let 与 letfn 在 clojure 中定义局部函数?

clojure - 有没有人知道 DSL 设计的好引用?

java - Web 检索到 clojure 上的延迟字符串错误

namespaces - Clojure:重新导出变量

clojure - Compojure:可选的 URL 参数

clojure - 有人知道 Clojure 机器学习框架吗?

clojure - Clojure Ring/Compojure REPL 中的动态处理程序更新

database - 查询以列出 Datomic 中的所有分区