php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40936 failed proxy authentication with parameters proxy_login and proxy_password
Submitted: 2007-03-28 13:49 UTC Modified: 2007-03-30 15:08 UTC
From: steffen dot herndl at gmx dot net Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5.2.1 OS: Win XP Pro / LINUX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: steffen dot herndl at gmx dot net
New email:
PHP Version: OS:

 

 [2007-03-28 13:49 UTC] steffen dot herndl at gmx dot net
Description:
------------
I have problems using PHP-SOAP-Extension over a proxy with required authentication.
We are using a "Checkpoint Firewall"
	
The Problem is reproducible under Windows XP Pro and Suse Linux 10 (and probably further systems) and with different PHP Versions (done with 5.1.0, 5.1.2, 5.1.6, 5.2.1).
The SoapClient doesn't use the parameters proxy_login and proxy_password     for authentication. It only works with parameters for HTTP authentication, but this causes other errors on the webservice. The webservice tries then to autenticate with the proxy credentials.

If I specify the options login and password for HTTP authentication, the script will pass the firewall check with the following headers. 
	POST http://(...)/WebService.asmx?WSDL HTTP/1.1
	Host: (...)
	Connection: Keep-Alive
	User-Agent: PHP-SOAP/5.2.1
	Content-Type: application/soap+xml; charset=utf-8; action="http://reg.beb.de/ns/wsdl/FinanceService/2007-03/HelloWorld"
	Content-Length: 220
	Authorization: Basic SGVybmRsUzpzcHJpbmcwNzAz
	Proxy-Authorization: Basic SGVybmRsUzpzcHJpbmcwNzAz

Instead of the firewall error I get an error from the webService. Because of the Authorization-Header the webserver tries to authenticate me, although no authentication is needed.

Without firewall the communication works properly. The same request done with nuSoap 0.7.2 and active firewall works too. (But I need to do this with PHP-Extension because of performance reasons)

Reproduce code:
---------------
$_param_wsdl = "http://(...)/WebService.asmx?WSDL";
$_param_client_opt = array( 
  //HTTP connection through a proxy server
  "proxy_host" => "123.ab.cde", 
  "proxy_port" => 80, 
  "proxy_login" => "username",
  "proxy_password" => "password",
//DEBUG PURPOSE
  "trace" => true,
  "exceptions" => true
);

//make CLIENT 
  $SOAPClient = new SoapClient($_param_wsdl, $_param_client_opt);
  var_dump($SOAPClient);	

//do REQUEST
  $result = $SOAPClient->HelloWorld();
  var_dump($result);	


Expected result:
----------------
It should work without errors...




Actual result:
--------------
Warning: SoapClient::SoapClient(http://(...)/WebService.asmx?WSDL) [function.SoapClient-SoapClient]: failed to open stream: 
	HTTP request failed! HTTP/1.0 401 Unauthorized in C:\htdocs\soap.php on line 37
	
Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O warning : failed to load external entity 
	"http://(...)/WebService.asmx?WSDL" in C:\htdocs\soap.php on line 37
	
SoapFault Object
(
	    [message:protected] => SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://(...)/WebService.asmx?WSDL'
	    [string:private] => 
	    [code:protected] => 0
	    [file:protected] => C:\htdocs\soap.php
	    [line:protected] => 37
	    [trace:private] => Array
	        (
	            [0] => Array
	                (
	                    [file] => C:\htdocs\soap.php
	                    [line] => 37
	                    [function] => SoapClient
	                    [class] => SoapClient
	                    [type] => ->
	                    [args] => Array
	                        (
	                            [0] => http://(...)/WebService.asmx?WSDL
	                            [1] => Array
	                                (
	                                    [soap_version] => 2
	                                    [proxy_host] => 123.ab.cde
	                                    [proxy_port] => 80
	                                    [proxy_login] => username
	                                    [proxy_password] => password
	                                    [trace] => 1
	                                    [exceptions] => 1
	                                )

	                        )

	                )

	        )

	    [faultstring] => SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://(...)/WebService.asmx?WSDL '
	    [faultcode] => WSDL
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-30 09:10 UTC] dmitry@php.net
I cannot understand the reason of failure ands need more info.
It seems that you provide HTTP request headres from other PHP script (I see authorization header but not login/password).

Could you please provide PHP code with corresponding HTTP headers that doesn't work and corresponding NuSOAP HTTP headers that works.

 [2007-03-30 13:42 UTC] steffen dot herndl at gmx dot net
Sorry,

this was not a bug. 

I did now a very very simple example an it works now. 


I'm really sorry.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC