加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-14 02:18:00 所属栏目:Windows 来源:网络整理
导读:我有一个脚本试图在后台克隆 Git存储库,而无需用户提供凭据.因此,它设置GIT_SSH_COMMAND以启用OpenSSH批处理模式.再现问题的示例脚本: import subprocess,syspopen = subprocess.Popen( ['git','clone','https://github.com/NiklasRosenstein/flux.git'],en
我有一个脚本试图在后台克隆 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:UsersniklasDesktop
λ 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协议,而不是http / https.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读