【问题标题】:(git tfs fetch) TF400324: Team Foundation services are not available, The underlying connection was closed(git tfs fetch) TF400324: Team Foundation 服务不可用,底层连接已关闭
【发布时间】:2019-01-23 19:03:37
【问题描述】:

我使用 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 Services 时使用的 TLS 版本?

【问题讨论】:

    标签: git tfs git-tfs tls1.0


    【解决方案1】:

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

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

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

      # set strong cryptography on 64 bit .Net Framework (version 4 and above)
      Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.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:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
      
    4. 重启。

    现在我的机器正在愉快地从 TFS 中提取大约一百个签入。

    【讨论】:

    • 您好,感谢您的帮助。此 reg 更改在客户端?你在 TFS 服务器上做了什么改变吗?
    • @galsi:这将在客户端计算机上。
    • 谢谢,不属于本主题您是否遇到过 GIT-TFS 内存使用问题?使用 --batch-size 标志?
    • 我正在尝试这样做.. git tfs clone zzz:8080/absr/main $/[tfs location] 。 –ignore-branches –debug... 但遇到同样的问题。我正在尝试从 TFS 获取代码并进入 Azure DevOps。我也试过这个但没用...github.com/microsoft/azure-repos-vscode/issues/…
    • @Ziggler:这些 SSL 问题可能很棘手。值得发布您自己的问题。
    【解决方案2】:

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

    1. 注销然后通过 Team-> Manage Connections 再次登录到 TFS。
    2. 再次映射我的项目。

    然后瞧!我成功签入了我的代码。也许这对其他人有帮助

    【讨论】:

    • 有趣。似乎您当时在 Visual Studio 中遇到了与 TFVC 相同的问题。不确定此解决方案是否可以修复 git tfs fetch
    猜你喜欢
    • 2019-02-10
    • 2023-03-22
    • 1970-01-01
    • 1970-01-01
    • 2016-07-06
    • 2020-06-16
    • 2020-11-20
    • 1970-01-01
    • 2019-04-19
    相关资源
    最近更新 更多