(git tfs fetch) TF400324:Team Foundation 服务不可用,基础连接已关闭



我已经使用 git-tfs 将近 5 年了,然后有一天我在运行git tfs fetch时出现以下错误:

TF400324: Team Foundation services are not available from server https://tfs.company.com/tfs/foo.
Technical information (for administrator):
The underlying connection was closed: An unexpected error occurred on a send.
The underlying connection was closed: An unexpected error occurred on a send.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host

我什至打开Fiddler看看发生了什么,当我的笔记本电脑尝试连接时,TFS服务器实际上断开了插座的连接。

在与我们的一位服务器管理员交谈后,我发现我们的 TFS 服务器上已禁用对 TLS 1.0 的支持,我想我已经有了我的吸烟枪。我认为我的笔记本电脑正在尝试使用 TLS 1.0 连接到我们的服务器,这当然会导致服务器关闭套接字。

如何更改git tfs连接到 Team Foundation 服务时使用的 TLS 版本?

我想通了,因为我怀疑在Team Foundation Servers上禁用TLS 1.0是问题的根源。在谷歌搜索git tfs tls 1.0之后,我偶然发现了为所有 .Net 应用程序启用强加密,这让我找到了修复程序。您需要为 .NET 应用程序启用强加密(呃,它在标题中是这样说的(。

  1. 打开 PowerShell 命令提示符,使用提升的权限运行它

  2. 对 64 位应用程序运行以下命令:

    # set strong cryptography on 64 bit .Net Framework (version 4 and above)
    Set-ItemProperty -Path 'HKLM:SOFTWAREWow6432NodeMicrosoft.NetFrameworkv4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
    
  3. 对 32 位应用程序运行此命令

    # set strong cryptography on 32 bit .Net Framework (version 4 and above)
    Set-ItemProperty -Path 'HKLM:SOFTWAREMicrosoft.NetFrameworkv4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
    
  4. 重新启动。

现在,我的机器很高兴地从 TFS 中拉下一百个左右的签到。

我对 TFS 没有太多技术知识,但每天我都必须从 Visual Studio 签入我的代码,最近我遇到了这个问题。上面提到的解决方案,从我的头上消失了。所以,我尝试了一种更简单的方法:

  1. 注销,然后通过团队>管理连接再次登录到 TFS。
  2. 再次映射我的项目。

瞧!我成功地签入了我的代码。也许这会帮助其他人

最新更新