Bug #50489 [Asn->Csd]: SoapClient + HTTPs + Proxy = SSL errors

From: Date: Thu, 29 Nov 2012 12:12:56 +0000
Subject: Bug #50489 [Asn->Csd]: SoapClient + HTTPs + Proxy = SSL errors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-175027@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=50489&edit=1

 ID:                 50489
 Updated by:         dmitry@php.net
 Reported by:        serbanghita at gmail dot com
 Summary:            SoapClient + HTTPs + Proxy = SSL errors
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Streams related
 Operating System:   Linux, Windows
 PHP Version:        5.2.11
 Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

The bug must be fixed in php-5.3.6 and above.


Previous Comments:
------------------------------------------------------------------------
[2012-02-14 16:03:26] serbanghita at gmail dot com

Are we going to see this fix live in both 5.2.x and 5.3.x?

Thanks!

------------------------------------------------------------------------
[2010-11-22 11:51:59] bruno dot premont at restena dot lu

This bug also applies to php-5.3.3 for which my patch
php-5.3.3_fopen_https_proxy_auth_fix does the trick.

------------------------------------------------------------------------
[2010-08-13 11:01:40] bruno dot premont at restena dot lu

It looks like php_stream_url_wrap_http_ex() from ext/standard/http_fopen_wrapper.c
should pick the proxy-authentication header and send it with CONNECT method for
proxy authentication to work with SOAP WSDL fetching (and at same time probably fixing quite a few
other bugs)

------------------------------------------------------------------------
[2010-04-25 17:56:23] hello at gmail dot com

The proxy's creditentials set through SoapClient options are ignored when the underlying target
is HTTPS, and then the proxy reply with a 407 error code.

------------------------------------------------------------------------
[2009-12-16 10:21:07] serbanghita at gmail dot com

Description:
------------
Apache 2.x
PHP 5.2.11

'./configure' '--prefix=/usr/lib/php5' '--host=i686-pc-linux-gnu'
'--mandir=/usr/lib/php5/man' '--infodir=/usr/lib/php5/info'
'--sysconfdir=/etc' '--cache-file=./config.cache'
'--with-pcre-regex=/usr' '--disable-cli'
'--with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-php5'
'--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active' '--without-pear'
'--disable-bcmath' '--with-bz2' '--disable-calendar'
'--with-curl' '--without-curlwrappers' '--disable-dbase'
'--enable-exif' '--without-fbsql' '--without-fdftk'
'--disable-filter' '--enable-ftp' '--with-gettext'
'--without-gmp' '--disable-ipv6' '--without-kerberos'
'--enable-mbstring' '--with-mcrypt' '--with-mhash'
'--without-msql' '--without-mssql' '--with-ncurses'
'--with-openssl' '--with-openssl-dir=/usr' '--enable-pcntl'
'--without-pgsql' '--without-pspell' '--without-recode'
'--disable-shmop' '--without-snmp' '--enable-soap'
'--enable-sockets' '--without-sybase' '--without-sybase-ct'
'--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm'
'--without-tidy' '--disable-wddx' '--disable-xmlreader'
'--disable-xmlwriter' '--with-xmlrpc' '--without-xsl'
'--enable-zip' '--with-zlib' '--disable-debug'
'--enable-dba' '--without-cdb' '--with-db4'
'--disable-flatfile' '--with-gdbm' '--disable-inifile'
'--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr'
'--disable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr'
'--without-xpm-dir' '--with-gd' '--with-imap'
'--with-imap-ssl' '--with-ldap' '--without-ldap-sasl'
'--with-mysql=/usr' '--with-mysql-sock=/var/run/mysqld/mysqld.sock'
'--with-mysqli=/usr/bin/mysql_config' '--without-pdo-dblib'
'--with-pdo-mysql=/usr' '--without-pdo-odbc' '--without-pdo-pgsql'
'--without-pdo-sqlite' '--with-readline' '--without-libedit'
'--without-mm' '--without-sqlite'

Reproduce code:
---------------
$SoapClient = new SoapClient(
			$soap_url_.'?wsdl', 		
			array(
					'location' 			=> $soap_url_,
					'cache_wsdl' 		=> WSDL_CACHE_NONE,
					'user_agent'		=> __FUNCTION__,
					'trace'				=> 1,
					'exceptions' 		=> 1,
					'allow_self_signed' => 1,
				
					'proxy_host' 		=> $proxy_host,
					'proxy_login'    	=> $proxy_user,
					'proxy_password' 	=> $proxy_pass,
					'proxy_port' 		=> (int)$proxy_port
			)		
		);

Expected result:
----------------
I expect everything to go smooth and fetch the WSDL file contents. I tested the proxy manually on
the https wsdl resource and it works.

Actual result:
--------------
Warning: SoapClient::SoapClient() [soapclient.soapclient]: SSL operation failed with code 1. OpenSSL
Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in
/var/www/vhosts/site/connect-soap.php on line 138

Warning: SoapClient::SoapClient(https://secure.site.com/api/soap.php?wsdl) [soapclient.soapclient]:
failed to open stream: Cannot connect to HTTPS server through proxy in
/var/www/vhosts/site/connect-soap.php on line 138

Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external
entity "https://secure.site.com/api/soap.php?wsdl"
in /var/www/vhosts/site/connect-soap.php on line 138



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



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


Thread (7 messages)

« previous php.bugs (#175027) next »