title: How to connect to a secure (https) proxy with curl and php?
body: <p>Modern browsers support HTTPS proxies that can be connected to via a PAC file (see <a href="https://www.igvita.com/2012/06/25/spdy-and-secure-proxy-support-in-google-chrome/">https://www.igvita.com/2012/06/25/spdy-and-secure-proxy-support-in-google-chrome/</a> if you're not familiar).</p>
  
  <p>I'm trying to replicate the same thing and connect to such a proxy via php CURL, but I'm simply getting a blank response, no headers or content. </p>
  
  <p>My code is as follows:</p>
  
  <pre><code>$url = "http://checkip.dyndns.com";
  $proxy = "proxy.domain.com:443";
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_HEADER, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL , 1);
  curl_setopt($ch, CURLOPT_PROXY, $proxy);
  curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'test:test');
  curl_setopt($ch, CURLOPT_PROXYTYPE, "CURLPROXY_HTTP");
  $response = curl_exec($ch);
  curl_close($ch);
  
  echo $response;
  </code></pre>
  
  <p>Any ideas?</p>