title: git ls-remote hangs when using GIT_SSH
body: <p>Recently I've started seeing a lot of timeouts when deploying to one of my EC2 servers. After some investigating I narrowed the problem down to <code>git ls-remote</code> and <code>GIT_SSH</code> script. </p>
  
  <p>This works 100% of the time:</p>
  
  <pre><code>eval `ssh-agent -s` &amp;&amp; ssh-add key.pem &amp;&amp; git ls-remote -h git@github.com:repo
  </code></pre>
  
  <p>This hangs 90% of the time:</p>
  
  <pre><code>GIT_SSH=wrapper.sh git ls-remote -h git@github.com:repo
  </code></pre>
  
  <p>This happens only on some of the servers. I've used the same wrapper for many projects and never had problems with it. I just setup Capistrano with <code>forward_agent</code> that uses a different wrapper and it's also failing.</p>
  
  <p>Any suggestions?</p>
  
  <p>p.s. The wrapper, for the sake of completeness:</p>
  
  <pre><code>#!/usr/bin/env bash
  /usr/bin/env ssh -o "StrictHostKeyChecking=no" -i "/path/to/key.pem" $1 $2
  </code></pre>
  
  <p>p.p.s. The original version of git was 1.9.1. Updating to 2.1.1 didn't help.</p>
  
  <p>--EDIT--</p>
  
  <p>Adding -v to the wrapper script allowed me to find the culprit:</p>
  
  <pre><code>debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  </code></pre>
  
  <p>Seems like a bug: <a href="https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1254085" rel="nofollow">https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1254085</a></p>
  
  <p>Specifying cipher with <code>-c 3des-cbc</code> seems to solve the problem with custom wrapper but it doesn't solve my problem with Capistrano.</p>