tags:

views:

2272

answers:

1

So, I'm trying to consume a webservice using something like this: $client = new SoapClient("some.wsdl", array('local_cert' => "cert_key.pem"));

I've done this successfully in the past with other web services that required a cert & key concatenated into the local_cert file. Now, I'm trying to consume a service that also relies on a trusted CA. This is a J2EE (Axis) webservice I'm consuming and every time I try to get opinions from the team hosting that service, they tell me that it must be a PHP issue...

The response I get from the SoapClient call is always a cannot connect. I used to be getting SSL errors, but then I realized I was using the wrong server cert, so now I at least know that I am on the right path of creating an SSL call.

What I don't know is how to make sure the CA cert gets included in that local_cert file. I have my server cert, my server cert key, and the CA cert, but is there an order in which I concatenate them in local_cert? Am I completely missing something?

Thanks in advance

+1  A: 

Neither IIS nor Apache, from my experience, require a CA file to authenticate a client certificate for web services. You need only specify the PEM file (and install it in the local store on IIS). I would say that your code looks good. When SSL fails for some authentication reason, you will typically get Forbidden messages. Errors that say you can't connect might involve ports not being open, such as port 443 for SSL.

Nick R.