title: Golang - TLS handshake error
body: <p>I am running a https web server in go. I am testing it using a angular web app (Chrome browser) that makes ajax calls to the web server. </p>
  
  <p>If I keep hitting the web server continuously everything seems working. But whenever I leave it idle for sometime and hit the web server the ajax call from browser doesn't get a response. Almost always I see this log line in my server log.</p>
  
  <p><code>2016/01/16 04:06:47.006977 http: TLS handshake error from 42.21.139.47:51463: EOF</code></p>
  
  <p>I can confirm that the IP address is my IP address. </p>
  
  <p>I am starting my https server like this:</p>
  
  <pre><code>r := mux.NewRouter()
  r.HandleFunc("/status", handleStatus)
  setUpLoginEndpoint(&amp;cfg.Session, r)
  setUpLogoutEndpoint(cfg.Session.CookieName, r)
  setUpChangePasswordEndpoint(cfg.Session.CookieName, r)
  setUpMetricSinkEndpoint(cfg.Metric.SinkApiKey, r)
  setUpMetricQueryEndpoint(cfg.Session.CookieName, r)
  http.ListenAndServeTLS(":443", "../cert.pem", "../keys.pem", &amp;Server{r})
  </code></pre>
  
  <p>I can confirm that I am closing the request body in every handler using defer r.Body.Close().</p>
  
  <p>I am using go 1.5.2. </p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Regards,</p>
  
  <p>Sathya</p>