Bug #70101 [Opn]: curl with digest authentication does work (all the time)

From: Date: Mon, 20 Jul 2015 10:51:47 +0000
Subject: Bug #70101 [Opn]: curl with digest authentication does work (all the time)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194566@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70101&edit=1

 ID:                 70101
 Updated by:         laruence@php.net
 Reported by:        roeycohen at gmail dot com
 Summary:            curl with digest authentication does work (all the
                     time)
 Status:             Open
 Type:               Bug
 Package:            cURL related
 Operating System:   windows and linux
 PHP Version:        5.6.11
 Block user comment: N
 Private report:     N

 New Comment:

which version of lib curl do you use?

I can not reproduce this error(it works fine with lib curl 7.22.0) here


Previous Comments:
------------------------------------------------------------------------
[2015-07-19 09:51:02] roeycohen at gmail dot com

Description:
------------
trying to use curl_exec with digest authentication does not work properly.
running the test script always fails to pass the security challenge.
using the browser or wget directly works perfectly.

also, trying to run the same test on another server of mine, works from an amazon linux with php
5.5.21 but does not work from my windows 7 x64 machine with php 5.6.11.

trying to run the test with php 5.5 or 5.4 using CLI on several windows machines caused a complete
crush of the php executable.

it seems like bug #69088 is related, but this bug also happens on linux (5.5).


Test script:
---------------
<?
$curl = curl_init();

$curl_options = [
	CURLOPT_HTTPAUTH => CURLAUTH_ANY,
	
	CURLOPT_USERPWD => 'test_user:password',
	CURLOPT_URL => 'http://test_user:password@httpbin.org/digest-auth/auth/user/password',
	CURLOPT_HEADER => true,
];
curl_setopt_array($curl, $curl_options);

curl_exec($curl);
curl_close($curl);

Expected result:
----------------
{
  "authenticated": true, 
  "user": "user"
}

Actual result:
--------------
"Authentication failed" (with header 401)


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=70101&edit=1


Thread (12 messages)

« previous php.bugs (#194566) next »