title: Git on Windows not working with remote because of "SSL protocol" errors
body: <h1>tl;dr</h1>
  
  <p>Git on Windows stops connecting to github because of mysterious "SSL protocol" errors. Halp!</p>
  
  <h1>The Issue</h1>
  
  <p>I'm developing on Windows, using a private GitHub repo for source control.  When I first boot my system, I'm able to access the remote repo without issue - <code>pull</code>, <code>push</code>, <code>fetch</code>, etc. all work just fine.</p>
  
  <p>After some amount of time(*), this stops, and I get the following error:</p>
  
  <blockquote>
    <p>fatal: unable to access '<a href="https://github.com/our-team/private-repo.git/" rel="nofollow">https://github.com/our-team/private-repo.git/</a>': Unknown SSL protocol error in connection to github.com:443</p>
  </blockquote>
  
  <p>(*) The amount of time seems variable - I've witnessed as little as an hour or two, up to a whole day.  Usually after coming back from the system sleeping, it seems to be an issue, but I don't know if it's caused by a time delay or by the system sleeping.</p>
  
  <p>Checking via cURL, I get</p>
  
  <pre><code>λ curl -v "https://github.com/our-team/private-repo.git/"
  *   Trying 192.30.252.130...
  * Connected to github.com (192.30.252.130) port 443 (#0)
  * successfully set certificate verify locations:
  *   CAfile: C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
    CApath: none
  * TLSv1.0, TLS handshake, Client hello (1):
  * Unknown SSL protocol error in connection to github.com:443
  * Closing connection 0
  curl: (35) Unknown SSL protocol error in connection to github.com:443
  </code></pre>
  
  <p>Using <code>set GIT_CURL_VERBOSE=1</code> with <code>git pull</code> shows similar information.  Sometimes it succeeds (see below), but most of the time it fails.  </p>
  
  <h1>Further Notes</h1>
  
  <p>There's a little bit of a sporadic nature to it - sometimes I can get requests to succeed, but once it starts exploding, it's generally broken 9 out of 10 requests or more.</p>
  
  <p>A successful cURL request looks like:</p>
  
  <pre><code>λ curl -v "https://github.com/our-team/private-repo.git/"
  *   Trying 192.30.252.130...
  * Connected to github.com (192.30.252.130) port 443 (#0)
  * successfully set certificate verify locations:
  *   CAfile: C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
    CApath: none
  * TLSv1.0, TLS handshake, Client hello (1):
  * TLSv1.0, TLS handshake, Server hello (2):
  * TLSv1.0, TLS handshake, CERT (11):
  * TLSv1.0, TLS handshake, Server finished (14):
  * TLSv1.0, TLS handshake, Client key exchange (16):
  * TLSv1.0, TLS change cipher, Client hello (1):
  * TLSv1.0, TLS handshake, Finished (20):
  * TLSv1.0, TLS change cipher, Client hello (1):
  * TLSv1.0, TLS handshake, Finished (20):
  * SSL connection using TLSv1.0 / AES128-SHA
  * Server certificate:
  *        subject: businessCategory=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; serialNumber=5157550; street=548 4th Street; postalCode=94107; C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
  *        start date: 2014-04-08 00:00:00 GMT
  *        expire date: 2016-04-12 12:00:00 GMT
  *        subjectAltName: github.com matched
  *        issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
  *        SSL certificate verify ok.
  &gt; GET /our-team/private-repo.git/ HTTP/1.1
  &gt; User-Agent: curl/7.41.0
  &gt; Host: github.com
  &gt; Accept: */*
  &gt;
  &lt; HTTP/1.1 301 Moved Permanently
  &lt; Server: GitHub.com
  &lt; Date: Mon, 11 May 2015 15:19:43 GMT
  &lt; Content-Type: text/html
  &lt; Content-Length: 178
  &lt; Location: https://github.com/our-team/private-repo/
  &lt; Vary: Accept-Encoding
  &lt; X-Served-By: 76f8aa18dab86a06db6e70a0421dc28c
  &lt;
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt;301 Moved Permanently&lt;/title&gt;&lt;/head&gt;
  &lt;body bgcolor="white"&gt;
  &lt;center&gt;&lt;h1&gt;301 Moved Permanently&lt;/h1&gt;&lt;/center&gt;
  &lt;hr&gt;&lt;center&gt;nginx&lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  * Connection #0 to host github.com left intact
  </code></pre>
  
  <h1>The Question</h1>
  
  <p>I've googled a good bit on trying to find this (over the course of several weeks, so I don't have links), but most suggestions seem to point at certificate errors or OpenSSL version mismatches / bugs (which wouldn't be sporadic like this AFAIK). </p>
  
  <p>What might be causing this failure, and how can I resolve it?</p>
  
  <h1>Relevant Software:</h1>
  
  <pre><code>λ git --version
  git version 1.9.5.msysgit.1
  
  λ curl --version
  curl 7.41.0 (i386-pc-win32) libcurl/7.41.0 OpenSSL/0.9.8zf zlib/1.2.8
  Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
  Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz
  </code></pre>