windows - GnuTLS:无法使用 GIT_SSH_COMMAND 获取随机数据

标签 windows git gnutls

我有一个脚本试图在后台克隆 Git 存储库,而用户无法提供凭据。因此,它设置 GIT_SSH_COMMAND 以启用 OpenSSH 批处理模式。重现问题的示例脚本:

import subprocess, sys
popen = subprocess.Popen(
  ['git', 'clone', 'https://github.com/NiklasRosenstein/flux.git'],
  env={'GIT_SSH_COMMAND': 'ssh -oBatchMode=yes'},
)
popen.wait()
sys.exit(popen.returncode)

在不设置 GIT_SSH_COMMAND 的情况下,命令运行正常。但是有了它,我得到了

C:\Users\niklas\Desktop
λ test
Cloning into 'flux'...
Error in GnuTLS initialization: Failed to acquire random data.
fatal: unable to access 'https://github.com/NiklasRosenstein/flux.git/': Couldn't resolve host 'github.com'

这里出了什么问题?使用 Git-for-Windows 2.6.1.windows.1

最佳答案

查看您的存储库 URL。您希望使用 ssh 或 git 协议(protocol),而不是 http/https。

关于windows - GnuTLS:无法使用 GIT_SSH_COMMAND 获取随机数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35449066/

相关文章:

linux - 在 Linux 中制作 tls 包时出现 "skipping incompatible/usr/lib/libc.so when searching for -lc"问题

android - 由于 GnuTLS 错误,Repo init 无法成功

IE 10.0 的 PHP UserAgent 不匹配

git - 使用经典 UI 在 Jenkins 管道上配置 git 超时

c++ - 编写不占用大量空间的 Windows 应用程序的语言

Git 因提交而损坏

python - 从特定提交提示 "requirements already satisfied"进行 Pip 安装

php - curl 错误 35 : gnutls_handshake() failed

安卓模拟器无法启动

.net - File.WriteAllText 抛出 UnauthorizedAccessException