#36104 [NEW]: ext/soap SoapClient connection problems using certificate
| From: | marcin dot dabrowski at gmail dot com | Date: | Fri, 20 Jan 2006 14:59:14 +0000 |
| Subject: | #36104 [NEW]: ext/soap SoapClient connection problems using certificate | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-92291@lists.php.net to get a copy of this message | ||
From: marcin dot dabrowski at gmail dot com
Operating system: Windows XP [Version 5.1.2600]
PHP version: 5.1.2
PHP Bug Type: SOAP related
Bug description: ext/soap SoapClient connection problems using certificate
Description:
------------
I'm trying to use SoapClient with certificate. When I set the cert file
path using options array I have 'Could not connect to host' error, while
setting the path as a property works like a charm.
I tried to see whats with the connection, and (using netcat: nc -vvnLp
433) I got the following results.
- with 'php test.php 1' netcat gives:
listening on [127.0.0.1] 443 ...
connect to [127.0.0.1] from (UNKNOWN) [127.0.0.1] 2055
sent 0, rcvd 0
- with 'php test.php 0' netcat gives:
listening on [127.0.0.1] 443 ...
connect to [127.0.0.1] from (UNKNOWN) [127.0.0.1] 2056
[binary stuff, SSL Handshake I think]
sent 0, rcvd 132
PS: I tried with http://snaps.php.net/win32/php5.1-win32-200601201130.zip,
same results.
Reproduce code:
---------------
<?php
$optionsInArray = (bool)$argv[1];
if ($optionsInArray) {
$opts = array(
'ssl' => array(
'local_cert' => './cli_crt.pem',
'allow_self_signed' => true
)
);
$ctx = stream_context_create($opts);
$soap = new SoapClient('a.wsdl', array(
'stream_context' => $ctx,
'local_cert' => './cli_crt.pem'
));
} else {
$soap = new SoapClient('a.wsdl');
$soap->_local_cert = './cli_crt.pem';
}
try {
var_export($soap->greet('Frodo'));
} catch (SoapFault $e) {
var_export($e);
}
?>
Expected result:
----------------
Both ways this script should produce successful connection, and actually
invoke the WebService. Only the second way it works as it should.
Actual result:
--------------
C:\usr\home\www\ws>php test.php 0
'Hello, World, and Frodo!!!'
C:\usr\home\www\ws>php test.php 1
SoapFault::__set_state(array(
'message' => '',
'string' => '',
'code' => 0,
'file' => 'C:\\usr\\home\\www\\ws\\test.php',
'line' => 21,
'trace' =>
array (
0 =>
array (
'function' => '__doRequest',
'class' => 'SoapClient',
'type' => '->',
'args' =>
array (
0 => '<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:Hellowsdl" xmlns:xsd="http://w
http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyl
coding/"><SOAP-ENV:Body><ns1:greet><person
xsi:type="xsd:string">Frodo</person></ns1:greet></SOAP-ENV:Body></SOAP-ENV:Envel
',
1 => 'https://localhost/ws/index.php?realm=Hello',
2 => 'urn:Hellowsdl#greet',
3 => 1,
),
),
1 =>
array (
'function' => '__call',
'class' => 'SoapClient',
'type' => '->',
'args' =>
array (
0 => 'greet',
1 =>
array (
0 => 'Frodo',
),
),
),
2 =>
array (
'file' => 'C:\\usr\\home\\www\\ws\\test.php',
'line' => 21,
'function' => 'greet',
'class' => 'SoapClient',
'type' => '->',
'args' =>
array (
0 => 'Frodo',
),
),
),
'faultstring' => 'Could not connect to host',
'faultcode' => 'HTTP',
))
--
Edit bug report at http://bugs.php.net/?id=36104&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36104&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36104&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36104&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36104&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36104&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36104&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36104&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36104&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36104&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36104&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36104&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36104&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36104&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36104&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36104&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36104&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36104&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36104&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36104&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36104&r=mysqlcfg