title: Curl options equivalent to "useDefaultCredentials" by Net.Webclient
body: <p>I try to access to the web with curl in a php script :</p>
  
  <pre><code>$ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, "https://www.google.fr");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  
  $result = curl_exec($ch);
  if (curl_errno($ch)) {
      echo 'Error:' . curl_error($ch);
  }
  
  curl_close ($ch);
  </code></pre>
  
  <p>It returns :</p>
  
  <blockquote>
    <p>Failed to connect to www.google.fr port 443: Connection refused</p>
  </blockquote>
  
  <p>That's normal, I'm behind a proxy, which require my Windows credentials (NTLM) to allow internet trafic.</p>
  
  <p>In MS Powershell, this works :</p>
  
  <pre><code>$request = New-Object System.Net.WebCLient
  $request.UseDefaultCredentials = $true
  $request.Proxy.Credentials = $request.Credentials
  $request.DownloadFile($url, $path)
  </code></pre>
  
  <p>Using the "DefaultCredentials" (= Windows Credentials) and send them to the proxy allows me to access to the web. But I don't now how it works.</p>
  
  <p>If I navigate using Firefox, Firefox always add a <strong>Proxy-Authorization</strong> header, with value : <strong>Negociate blablablablababalazdlad...</strong></p>
  
  <p>I want to transpose the .NET useDefaultCredentials solution to cURL, I tried : </p>
  
  <pre><code>$ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, "https://www.google.fr");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  
  curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM );
  curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM );
  
  $result = curl_exec($ch);
  if (curl_errno($ch)) {
      echo 'Error:' . curl_error($ch);
  }
  
  curl_close ($ch);
  </code></pre>
  
  <p>Without success</p>