[SOAP] SOAP SSL Context : Could not connect to host

[email protected] (Mickael L)
Newsgroups php.soap
Message-ID <[email protected]>
Hi, 
I have a problem when I try to perform my soap call over HTTPS, but without
client certificate authentication (local_cert). 
The Server application does not manage private key, just a public
self-signed certificate. 

So I just have the public certificate from the server application which is
encoded in PEM format.

I have tried to modify the SSL context without success.
Note: $cafile in the commented line refers to the public certificate file
that i recover from the WebServer with my Firefox navigator.

Is it a bug? 
Can phpsoap work with only a server certificate?

Thanks a lot.

------------------------------------------------------------
Reproduce code:
$soapOptions['trace'] = true;
$soapOptions['soap_version'] = SOAP_1_1;

// SSL Configuration
if ($SSLcontext) {
  $ctx = stream_context_create();
  stream_context_set_option($ctx, 'ssl', 'allow_self_signed',true);
  stream_context_set_option($ctx, 'ssl', 'verify_peer',true);
  stream_context_set_option($ctx, 'ssl', 'allow_self_signed',true);
  //stream_context_set_option($ctx, 'ssl', 'cafile',$cafile);
  $soapOptions['stream_context'] = $ctx;
}

$soapClient = new SoapClient($wsdlFile, $soapOptions);

$soapClient->echoString('Hello World!');
-------------------------------------------------------------
Result: 
If I dont modify the SSL context, i have the following error :
faultcode: soapenv:Server
faultstring: Policy Falsified

If I modify the SSL context, i have the following error :
faultcode: HTTP
faultstring: Could not connect to host


-- 
View this message in context: http://www.nabble.com/SOAP-SSL-Context-%3A-Could-not-connect-to-host-tp25007848p25007848.html
Sent from the Php - Soap mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.