title: Docker push - net/http: TLS handshake timeout
body: <p>I've deployed a private docker image registry on an AWS EC2 Ubuntu 14.04 instance. The registry is secured using <a href="https://letsencrypt.org/" rel="noreferrer">Let's Encrypt</a> certificate.</p>
  
  <p>Unfortunately, I'm getting <code>net/http: TLS handshake timeout</code> for <code>docker push</code> operations that take longer than 300s:</p>
  
  <p>This is the output of the <code>time'd</code> command:</p>
  
  <pre><code>[luqo33@home-pc containers]$ time docker push &lt;my-registry-domain:5000&gt;/nginx                                                    
  The push refers to a repository [&lt;my-registry-domain:5000&gt;/nginx]
  dda5a806f0b0: Layer already exists
  ec35cfccb7f7: Layer already exists
  94c1a232bb3f: Layer already exists
  6d6b9812c8ae: Layer already exists
  695da0025de6: Retrying in 1 second
  fe4c16cbf7a4: Pushing [================================================&gt;  ]   119 MB/123 MB
  net/http: TLS handshake timeout
  
  real    5m0.847s
  user    0m0.097s
  sys     0m0.017s
  </code></pre>
  
  <p>Logs of the <code>regsitry:2</code> container do not show any errors - other than the notification that there was an unexpected EOF while receiving data. I can also push images that take less than 5min to push without problems.</p>
  
  <p>I'm suspecting that it's a system setting at blame as the timeout happens always once the operations goes beyond 300 seconds. There isn't any load balancer or other proxy. <code>&lt;my-registry-domain:5000&gt;</code> points directly at the server IP.</p>
  
  <p>How can I further investigate and possible remedy this situation?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The same happens when I push images to other server providers (DigitalOcean), AWS ECS registry or even Docker Hub! I find it hard to believe that the Docker client would have a built-in handshake timeout of 300s.</p>
  
  <p>I'm thinking that perhaps I should start look for the solution at the network level - with my hardware (wi-fi router) or my ISP.</p>
  
  <p>Anybody has a clue what is happening here?</p>