title: cURL a local GO server using a self signed certificate
body: <p>So i have a simple <strong>GO</strong> server running on port <code>8080</code> using a self-signed certificate that i created with the following command:</p>
  
  <pre><code>openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out local.crt -keyout local.key
  </code></pre>
  
  <p>When creating it i set the fields to these values:
  <a href="https://i.stack.imgur.com/A9yrv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A9yrv.png" alt="enter image description here"></a><br>
  As you can see i skipped everything but the <code>fully qualified host name</code> which i set to <code>go-auth</code></p>
  
  <p>I started my go server using the <code>local.key</code> and <code>local.crt</code> files successfully.</p>
  
  <p>I tried <strong>cURLing</strong> it like:</p>
  
  <pre><code>➜  certs git:(master) ✗ curl --proxy-cacert local.crt https://go-auth/
  curl: (6) Could not resolve host: go-auth
  
  ➜  certs git:(master) ✗ curl --proxy-cacert local.crt https://localhost:8080/
  curl: (60) SSL certificate problem: self signed certificate
  More details here: https://curl.haxx.se/docs/sslcerts.html
  
  curl failed to verify the legitimacy of the server and therefore could not
  establish a secure connection to it. To learn more about this situation and
  how to fix it, please visit the web page mentioned above.
  </code></pre>
  
  <p>After that i tried to get the certs from the running server and saving it to the <strong>cacert.pem</strong> file and tried again:</p>
  
  <pre><code>➜  certs git:(master) ✗ echo quit | openssl s_client -showcerts -servername go-auth -connect localhost:8080 &gt; cacert.pem
  depth=0 CN = go-auth
  verify error:num=18:self signed certificate
  verify return:1
  depth=0 CN = go-auth
  verify return:1
  DONE
  
  ➜  certs git:(master) ✗ curl --cacert cacert.pem https://go-auth/
  curl: (6) Could not resolve host: go-auth
  
  ➜  certs git:(master) ✗ curl --proxy-cacert cacert.pem https://go-auth/
  curl: (6) Could not resolve host: go-auth
  </code></pre>
  
  <p>At this point i don't know, i was trying to follow the answer to this question: <a href="https://stackoverflow.com/questions/27611193/use-self-signed-certificate-with-curl">Use self signed certificate with cURL?</a> but did not get the desired result.</p>