title: How to send a https request with a certificate golang
body: <p>I have a server which has a rest API running over https. I want to make a call to this rest api in my application which is running in different port but since this is over https I am getting </p>
  
  <pre><code>Post https://localhost:8080/api/v1/myapi: x509: certificate signed by unknown authority
  </code></pre>
  
  <p>I have 2 files pulic_key.pem and private_key which can used to verify the certificate. How can verify certificate while sending rest request using golang? I am using <code>&amp;http.Client{}</code> to send a rest request. Here is what I am doing to ignore the certificate right now.</p>
  
  <pre><code>tr := &amp;http.Transport{
  TLSClientConfig: &amp;tls.Config{InsecureSkipVerify: true},
  }
  
  client := &amp;http.Client{Transport: tr}
  </code></pre>