PHP SOAP webservice call with two way SSL authentication -


i using curl api call soap web service 2 ssl authentication , uses username,passworddigest , nounce in soap headers .

curl api code is:

$soap_do = curl_init(); curl_setopt($soap_do, curlopt_url,            "webservice_url" ); curl_setopt($soap_do, curlopt_connecttimeout, 1000); curl_setopt($soap_do, curlopt_timeout,        1000); curl_setopt($soap_do, curlopt_returntransfer, true ); curl_setopt($soap_do, curlopt_ssl_verifypeer, true); curl_setopt($soap_do, curlopt_post,           true ); curl_setopt($soap_do, curlopt_verbose, '1'); curl_setopt($soap_do, curlopt_sslversion, '1'); curl_setopt($soap_do, curlopt_ssl_verifyhost, 2); curl_setopt($soap_do, curlopt_sslkeypasswd, 'secret'); curl_setopt($soap_do, curlopt_sslkeytype, 'pem'); curl_setopt($soap_do, curlopt_sslkey,"c:/xp/projects/setups/certs/key.pem"); curl_setopt($soap_do, curlopt_postfields, $in); curl_setopt($soap_do, curlopt_httpheader,     array('content-type: text/xml; charset=utf-8', 'content-length: '.strlen($in) )); $out = curl_exec($soap_do); if($out === false) { echo "err"; $err = 'curl error: ' . curl_error($soap_do); curl_close($soap_do); echo $err; return $err; } else { echo "response =="; echo $out; echo "execu"; curl_close($soap_do); return 'operation completed without errors'; } 

cacerts set in php.ini file:

response policy falsified, can please review sslkey set , outbound post message encrypted key?

full response is:

response ==<?xml version="1.0" encoding="utf-8"?> <soapenv:envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> <soapenv:body>     <soapenv:fault>         <soapenv:code>             <soapenv:value>soapenv:receiver</soapenv:value>         </soapenv:code>         <soapenv:reason>             <soapenv:text xml:lang="en-us">policy falsified</soapenv:text>         </soapenv:reason>         <soapenv:role>removed privacy</soapenv:role>         <soapenv:detail>             <l7:policyresult status="bad request" xmlns:l7="http://www.layer7tech.com/ws/policy/fault"/>         </soapenv:detail>     </soapenv:fault> </soapenv:body> </soapenv:envelope> execu*   trying 216.178.233.150... * connected impl.client.com (216.178.233.150) port 443 (#0) * set certificate verify locations: *   cafile: c:/project_ah/php/cacert.pem capath: none * ssl connection using tlsv1.0 / dhe-rsa-aes256-sha * server certificate: *    subject: c=us; st=maryland; l=baltimore; o=centers medicare & medicaid services; ou=ois; cn=removed privacy *    start date: 2014-12-31 00:00:00 gmt *    expire date: 2016-01-23 23:59:59 gmt *    subjectaltname: removed privacy *    issuer: c=us; o=symantec corporation; ou=symantec trust network; cn=symantec class 3 secure server ca - g4 *    ssl certificate verify ok. > post /imp1/servie http/1.1 host: removed privacy accept: */* content-type: text/xml; charset=utf-8 content-length: 2517 expect: 100-continue  < http/1.1 100 continue < http/1.1 500 internal server error < server: apache-coyote/1.1 < content-type: application/soap+xml;charset=utf-8 < content-length: 746 < date: wed, 03 jun 2015 03:53:13 gmt < connection: close <  * closing connection 0 

note: not using soapclient because fails in parsing wsdl due nested xsds defining namespaces again


Comments