title: PHP cURL Basic Authentication Alternatives for CURLOPT_HTTPHEADER & CURLOPT_USERPWD...?
body: <p>Are there any alternatives to using CURLOPT_HTTPHEADER &amp; CURLOPT_USERPWD for supplying Basic Authentication for cURL PHP?</p>
  
  <p>I have a super long password, so CURLOPT_USERPWD wont work as it truncates at 256 characters.</p>
  
  <pre><code>curl_setopt($data, CURLOPT_USERPWD, $username . ":" . $password);
  </code></pre>
  
  <p>And I would like to stay away from using CURLOPT_HTTPHEADER for security reasons.</p>
  
  <pre><code>curl_setopt($data, CURLOPT_HTTPHEADER, "Authorization: Basic " . base64_encode($username . ":" . $password));
  </code></pre>
  
  <p>Any alternatives?</p>