【问题标题】:Push/pull to Github is broken in Android Studio and IntelliJ推/拉到 Github 在 Android Studio 和 IntelliJ 中被破坏
【发布时间】:2018-08-04 00:53:42
【问题描述】:

我已设置 SSH 以从 Android Studio (3.0.1 - Build #AI-171.4443003)和 IntelliJ(2017.3.4 - Build 173.4548.28),直到昨天(2018 年 2 月 22 日)一切正常。

突然之间(2018 年 2 月 23 日),当我尝试在 IntelliJ 或 Android Studio 中向 Github 推送或拉取任何内容时,它失败了,并且我在“版本控制控制台”中收到以下消息:

16:41:14.159: [onebusaway-android] git -c core.quotepath=false pull --progress --no-stat -v --progress upstream master
java.io.IOException: There was a problem while connecting to github.com:22
        at com.trilead.ssh2.Connection.connect(Connection.java:791)
        at com.trilead.ssh2.Connection.connect(Connection.java:577)
        at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:172)
        at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:138)
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
        at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:92)
        at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:230)
        at com.trilead.ssh2.Connection.connect(Connection.java:743)
        ... 3 more
Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
        at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:413)
        at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:754)
        at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:469)
        at java.lang.Thread.run(Thread.java:745)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

这在两台不同的机器上同时发生,一台使用 Windows 7 Enterprise,另一台使用 Windows 10。

为什么突然停止工作,我该如何解决?

【问题讨论】:

    标签: git android-studio github intellij-idea ssh


    【解决方案1】:

    IntelliJ 遇到了来自 February 23, 2018github push, pull 问题。 原因是 IntelliJ 中 Built-in SSH 的弱加密不再被 github 支持。

    解决方案很简单,无需升级 IntelliJ。

    [IntelliJ - File - Settings - Version Controll - Git] 
    
    You can change 'SSH executable' from 'Build-in' to 'Native'.
    

    由于 'Native' 使用 git.exe,所以没有问题,因为大多数 git 客户端已经应用了最新的加密。 如果您使用的是旧的 git 客户端,请更新!

    https://git-scm.com/download

    ps) IntelliJ、PhpStorm 和 Android Studio 都有同样的问题,可以用同样的方法解决。

    背景)肖恩·巴博的回答。

    【讨论】:

    • 如 IntelliJ 问题中所述,请注意“切换到 Native 将起作用,但如果您的密钥受密码保护,则需要先将它们加载到 ssh-agent 中”。
    • if your keys are passphrase-protected, you will need to load them into ssh-agent first 感谢您的重要cmets。
    【解决方案2】:

    解决方案:

    对于 IntelliJ - 更新到 IntelliJ 2018.1 或 2017.3.5 (173.4674.1)。

    对于 Android Studio - 更新到 Android Studio 3.1 see this comment on issue tracker

    背景:

    Github 于 2018 年 2 月 23 日通过永久删除对弱加密标准的支持来触发此事件:

    https://github.com/blog/2507-weak-cryptographic-standards-removed

    但是,IntelliJ 和 Android Studio 在某些使用强安全密码的 SSH 握手方面仍然存在问题:

    此基础问题已在 IntelliJ 2018.1 中修复: https://youtrack.jetbrains.com/issue/IDEA-140196#comment=27-2717976

    ...以及 2017.3.5 (173.4674.1)。

    对于 Android Studio,该修复程序在 Studio 3.1 see this comment on issue tracker 中可用。

    正如@Been Kyung Yoon 在他的回答中提到的一种解决方法,您可以将 SSH 可执行文件更改为“Native”,但正如 IntelliJ 问题中所述,请注意:

    切换到 Native 可以,但如果您的密钥受密码保护,则需要先将它们加载到 ssh-agent 中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-28
      • 1970-01-01
      • 2021-09-22
      • 2023-03-16
      • 2019-11-26
      • 2022-08-21
      相关资源
      最近更新 更多