#49230 [NEW]: error using SoapClient with certificates in PHP

From: Date: Wed, 12 Aug 2009 05:58:18 +0000
Subject: #49230 [NEW]: error using SoapClient with certificates in PHP
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-5650@lists.php.net to get a copy of this message
From: nirjal_nirvana at hotmail dot com Operating system: Windows XP PHP version: Irrelevant PHP Bug Type: Website problem Bug description: error using SoapClient with certificates in PHP Description: ------------ Hi, I have been trying to access webservice in asp.net using php client. The webservice requires the use of a certificate, I've downloaded the certificate from a CA server thats from a windows server 2008 and the client certificate has a .cer extension. When I use the certificate from an asp.net client the webservice is consumed, but when I try it from php I get a warning and an error Reproduce code: --------------- $soap = new SoapClient('https://192.168.51.212/test.asmx?wsdl', array ( 'local_cert' => './path/nkCert.cer' )); } catch (Exception $e) { echo "Caught exception: ". $e->getMessage() . "\n"; } Actual result: -------------- Warning: SoapClient::SoapClient() [soapclient.soapclient]: Unable to set private key file `C:\xampp\htdocs\path\nkCert.cer' in C:\xampp \htdocs\CertApp2.php on line 40 Warning: SoapClient::SoapClient() [soapclient.soapclient]: failed to create an SSL handle in C:\xampp\htdocs\CertApp2.php on line 40 Warning: SoapClient::SoapClient() [soapclient.soapclient]: Failed to enable crypto in C:\xampp\htdocs\CertApp2.php on line 40 Warning: SoapClient::SoapClient(https://192.168.51.212/test.asmx?wsdl) [soapclient.soapclient]: failed to open stream: operation failed in C: \xampp\htdocs\CertApp2.php on line 40 Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://192.168.51.199/ MGACalls.asmx?wsdl" in C:\xampp\htdocs\CertApp2.php on line 40 Caught exception: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://192.168.51.212/test.asmx?wsdl' : failed to load external entity "https://192.168.51.212/test.asmx?wsdl" Fatal error: Call to a member function __getFunctions() on a non- object in C:\xampp\htdocs\CertApp2.php on line 51 -- Edit bug report at http://bugs.php.net/?id=49230&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49230&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49230&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49230&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49230&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49230&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49230&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49230&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49230&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49230&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49230&r=support Expected behavior: http://bugs.php.net/fix.php?id=49230&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49230&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49230&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49230&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49230&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49230&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49230&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49230&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49230&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49230&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49230&r=mysqlcfg

« previous php.webmaster (#5650) next »