|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-27 02:02 UTC] degeberg@php.net
-Status: Open
+Status: Bogus
[2010-05-27 02:02 UTC] degeberg@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 22:00:01 2025 UTC |
Description: ------------ When using CURLOPT_USERPWD within a cURL request u have to provide both username AND password to work properly. I had a problem with accessing pages with Basicauth and NO username, just a Password. curl then calculates the base64 wrong. As workaround i have to calculate the base64 manually and provide it to curl via the headers option Test script: --------------- $curl = curl_init('http://localhost'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_USERPWD, ':password'); // no username curl_setopt($curl, CURLOPT_VERBOSE, true); $response = curl_exec($curl); curl_close($curl); Expected result: ---------------- something like this in the request headers: "Authorization: Basic OnRlc3Q=" Actual result: -------------- "Authorization: Basic Og==" (only the ":")