php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49230 error using SoapClient with certificates in PHP
Submitted: 2009-08-12 05:58 UTC Modified: 2009-08-12 09:50 UTC
From: nirjal_nirvana at hotmail dot com Assigned:
Status: Not a bug Package: Website problem
PHP Version: Irrelevant OS: Windows XP
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nirjal_nirvana at hotmail dot com
New email:
PHP Version: OS:

 

 [2009-08-12 05:58 UTC] nirjal_nirvana at hotmail dot com
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 




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-12 09:50 UTC] bjori@php.net
This is not a problem with the www.php.net website.
Furthermore, we only support binaries from php.net, not xampp.

...And this is not a support forum. If you really believe this is a problem in the PHP language itself then create short, but *complete* (i.e. 192.158.51.212 doesn't work for me, neither does test.asmx) reproduce example and refile the bug report in the proper category.

-Hannes

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Dec 23 14:00:01 2025 UTC