title: Use cURL with SNI (Server Name Indication)
body: <p>I am trying to use cURL to post to an API that just started using SNI (so they could host multiple ssl certs on 1 IP address). </p>
  
  <p>My cURL stopped working as a result of this move to SNI. They explained that it's because cURL is getting *.domain-a.com back instead of *.domain-b.com so the SSL fails. </p>
  
  <p>This seems to be a bug in cURL because the API URL has no errors when visited from a browser.</p>
  
  <p>Using this code, it does work: </p>
  
  <pre><code>exec('curl -k -d "parameters=here", https://urlhere.com/', $output);
  print_r($output);
  </code></pre>
  
  <p>However, using -k is bad because it doesn't verify the SSL cert. </p>
  
  <p>Using this code, does NOT work: </p>
  
  <pre><code>exec('curl -d "parameters=here", https://urlhere.com/', $output);
  print_r($output);
  </code></pre>
  
  <p>So my question is, how can I use curl with SNI and still verify the SSL (not have to use -k). Is there another setting in PHP or a cURL option I can set to work around this?</p>