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

Nik*_*s R 5 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)
Run Code Online (Sandbox Code Playgroud)

没有设置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'
Run Code Online (Sandbox Code Playgroud)

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

ldr*_*drg 0

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