title: How do I get the PHP SOAP client to communicate with a service running over SSL with an invalid certificate
body: <p>I'm trying to consume a SOAP service using the PHP SOAP client but it fails with the message:</p>
  
  <pre><code>SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://domain.com/webservice.asmx?wsdl' : failed to load external entity "https://domain.com/webservice.asmx?wsdl"\n in /Users/andrewdchancox/Projects/test/testsoap.php on line 10
  </code></pre>
  
  <p>I've downloaded the wsdl file and served it from a local instance of apache and it loads without any issues. The only thing I can think it could be is that the web service is running over SSL with a self signed certificate - when I wget the wsdl I get the following error:</p>
  
  <pre><code>--2012-09-11 16:28:39--
  https://domain.com/webservice.asmx?wsdl
  Resolving domain.com (domain.com)... 11.111.111.11
  Connecting to domain.com (domain.com)|11.111.111.11|:443... connected.
  ERROR: The certificate of ‘domain.com’ is not trusted.
  ERROR: The certificate of ‘domain.com’ hasn't got a known issuer.
  </code></pre>
  
  <p>I've googled around and thoroughly read the PHP docs for the PHP SOAP client - <a href="http://php.net/manual/en/class.soapclient.php" rel="nofollow">http://php.net/manual/en/class.soapclient.php</a> and it's constructor - <a href="http://www.php.net/manual/en/soapclient.soapclient.php" rel="nofollow">http://www.php.net/manual/en/soapclient.soapclient.php</a> and not found anything to help.</p>
  
  <p>Anyone got any ideas?</p>