title: curl gnutls_handshake failed TLS connection was non-properly terminated
body: <p>I would like to get the info from my custom Haystack service with the command
  <code>curl -v -X GET https://&lt;myIP&gt;:8443/api/haystack/about</code> and it fails, the following is the log from above command</p>
  
  <pre><code>Note: Unnecessary use of -X or --request, GET is already inferred.
  *   Trying &lt;myproxy-ip&gt;...
  * Connected to proxy.example.com (myproxy-ip) port 911 (#0)
  * Establish HTTP proxy tunnel to &lt;myIP&gt;:8443
  &gt; CONNECT &lt;myIP&gt;:8443 HTTP/1.1
  &gt; Host: &lt;myIP&gt;:8443
  &gt; User-Agent: curl/7.47.0
  &gt; Proxy-Connection: Keep-Alive
  &gt;
  &lt; HTTP/1.1 200 Connection established
  &lt;
  * Proxy replied OK to CONNECT request
  * found 148 certificates in /etc/ssl/certs/ca-certificates.crt
  * found 597 certificates in /etc/ssl/certs
  * ALPN, offering http/1.1
  * gnutls_handshake() failed: The TLS connection was non-properly terminated.
  * Closing connection 0
  curl: (35) gnutls_handshake() failed: The TLS connection was non-properly terminated.
  </code></pre>
  
  <p>At the same time, the Haystack service is having a front end web portal, when I access with Chrome, I can see the warning <code>Privacy Error</code> and <code>NET::ERR_CERT_AUTHORITY_INVALID</code>, but i still can proceed on the browser. I guess this might be the reason causing my <code>curl</code> fail.</p>
  
  <p>Any idea?
  Thanks</p>