Guys,
I’m trying to connect to a web-service and was provided a certificate as a .cer file. I have tried to use it like this:
$client = new SoapClient(self::O_PINGWSDL,
array('login' => self::O_USERID,
'password' => self::O_PASSWORD,
'cache_wsdl' => 'WSDL_CACHE_NONE',
'local_cert' => 'path/to/cert.cer',
'trace' => 1));
I expected this to work but I’m still getting this error:
SoapFault exception: [HTTP] Could not connect to host in …
So, I visited the address specified in the <soap:address location=“…”/> element of the WSDL and my browser prompted me to accept the certificate, which I did, and got a result.
So, I’m allowed on to their server, but I can’t do it with SOAPClient for some reason.
Here is a var_dump() of my SOAPClient object:
object(SoapClient)[5]
public '_login' => string 'our_username' (length=16)
public '_password' => string 'our_password' (length=16)
public 'trace' => int 1
public '_stream_context' => resource(20, stream-context)
public '_soap_version' => int 1
public 'sdl' => resource(21, Unknown)
Any ideas where I might be going wrong? The _stream_context value has baffled me a little TBH; I was expecting it to say “_local_cert” but it doesn’t. Is this anything to do with using a .cer certificate instead of a .pem do you think?
Thanks all