title: fake Server Name indication (SNI) in libcurl with OpenSSL backend
body: <p>I have libcurl built with OpenSSL backend. I want to set SNI to some specified string. the way that I could find is using the function <code>SSL_set_tlsext_host_name</code> which takes the <code>SSL *</code> instance and a string and then sets it. (see <a href="https://stackoverflow.com/a/5113466/3754125">https://stackoverflow.com/a/5113466/3754125</a>)</p>
  
  <p>However curl_easy does not have a call back to retrieve <code>SSL*</code> instance. Is there an alternate way to do so?</p>
  
  <p>Some more context:
  In my environment, I have to use <code>CURLOPT_RESOLVE</code> to resolve the FQDN to IPv4.
  There is the FQDN: <code>const char *fqdn</code>
  IPv4 which <code>fqdn</code> should resolve to: <code>uint32_t ipv4</code>
  fake SNI: <code>const char *sni</code>
  The gist looks something like:</p>
  
  <pre><code>CURL *ez;
  char buf[ENOUGH];
  struct curl_slist *resolver;
  /* ... */
  snprintf(buf, sizeof(buf), "%s:%d:%d.%d.%d.%d", fqdn, port, IP(IPv4));
  resolver = curl_slist_append(NULL, buf);
  curl_easy_setopt(ez, CURLOPT_RESOLVE, resolver);
  </code></pre>
  
  <p>After this I need to set the SNI to the fake SNI without touching the resolver.</p>