Project

General

Profile

Actions

Bug #20770

closed

[t3lib_div::getURL][curl] CURLOPT_HTTPAUTH missing

Added by Amar Bouchibane over 14 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-07-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
5.2
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

Description

When using a basic authentication (Apache) on site curl won't get the content because of missing CURLOPT_HTTPAUTH/CURLOPT_USERPWD setopts.

I have attached a patch of t3lib_div which requires a "curl" user with a password generated from data "curl" hashed with the "encryptionKey" (see getURL). I don't know if this is very handy.

(issue imported from #M11559)


Files

class.t3lib_div.php (192 KB) class.t3lib_div.php Administrator Admin, 2009-07-19 22:55

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #28344: Include HTTP Request2 for better HTTP handlingClosedPhilipp Gampe2011-07-202011-07-25

Actions
Actions #1

Updated by Marcus Krause over 14 years ago

The general idea is nice. However, username and password being hardcoded isn't handy at all and this patch won't make it to TYPO3 Core as such.

Actions #2

Updated by Philipp Gampe over 12 years ago

  • Target version deleted (0)

I think t3lib_http_request handles this as well.

This should be set to feedback for a month and then be closed.

Actions #3

Updated by Thorsten Kahler over 12 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Amar Bouchibane
  • Priority changed from Should have to Could have
  • TYPO3 Version changed from 4.2 to 4.6
  • Complexity set to hard

Hi Amar, could you please give some more details on this issue? Perhaps you could also provide the patch as unified diff?

Actions #4

Updated by Amar Bouchibane over 12 years ago

Hi Thorsten,

I had (and still have) turned into a portal where Apaches' Basic Authentication is activated. My site uses the "mnogosearch" extension (and thus the "pagepath" extension).

I can still reproduce the problem when I change and then save one record in the TYPO3 BE that has to be indexed.

The mnogosearch extension calls (via tx_mnogosearch_tcemain::processDatamap_afterDatabaseOperations) the tx_pagepath_api::getPagePath method. Within this method t3lib_div::getURL will be called. When I debug the code, I notice that the return value of getURL (= curl_exec) is always FALSE:

When I use the "$report" in getURL, I get back this array:

$report : array (
error: 22,
message: "The requested URL returned error: 401",
lib: "CURL)

The two lines I've added (which worked then on a simple HTTP server without proxy) were these:

modified t3lib_div::getURL:
--------------------------
...
curl_setopt($ch, CURLOPT_FAILONERROR, 1);

// Added: Amar --- begin
curl_setopt($ch, CURLOPT_USERPWD, 'curl:'.hash_hmac('md5', 'curl', $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']));
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
// Added: Amar --- end

// May fail (PHP 5.2.0 + and 5.1.5 +) when open_basedir or safe_mode are enabled
$followLocation = @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
...

On the other hand the "Retrieve/Update" in the ExtManager although uses getURL(), but works perfectly... even with a "curlProxyServer".

Anyway my workaround doesn't work for me anymore (in TYPO3 4.4.7). I got to admit that I use SSL and a curl-Proxy now.
But it worked for me at that time with a simple HTTP-Server without a curl-Proxy.

Actions #5

Updated by Alexander Opitz over 10 years ago

Hi,

as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.1)?

Actions #6

Updated by Alexander Opitz about 10 years ago

  • Status changed from Needs Feedback to Closed
  • Assignee deleted (Amar Bouchibane)
  • Is Regression set to No

No feedback within the last 90 days => closing this ticket.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF