title: Making SOAP-call in PHP and setting SSL version
body: <p>I've made several scripts working with external WSDL. I have encountered one I have to integrate into our system that I can't get to work. I'be been trying for a week without any result.</p>
  
  <p>The script fails on creating the constructor already:</p>
  
  <pre><code>$client = new SoapClient("https://webtjener09.kred.no/TestWebservice/OppdragServiceSoapHttpPort?WSDL");
  </code></pre>
  
  <p>Gives the error:</p>
  
  <pre><code>PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://webtjener09.kred.no/TestWebservice/OppdragServiceSoapHttpPort?WSDL' : failed to load external entity "https://webtjener09.kred.no/TestWebservice/OppdragServiceSoapHttpPort?WSDL"
  </code></pre>
  
  <p>I do have openssl installed and working with PHP, and remember that I already have other working SOAP-calls to other WSDL's over SSL. I found out that I can not solve this with a cert either since it fails already at the constructor.</p>
  
  <p><strong>But:</strong>
  I tried to connect to the remote server with openssl command line, and this command also failed:</p>
  
  <pre><code>openssl s_client -connect webtjener09.kred.no:443 -state
  </code></pre>
  
  <p>But then I tried forcing it to SSL3 and it worked perfectly, like this:</p>
  
  <pre><code>openssl s_client -ssl3 -connect webtjener09.kred.no:443 -state
  </code></pre>
  
  <p>So that got me thinking that I had to match the SSL version of the remote server. To doublecheck I also tried making a cURL connection via PHP and it failed until I added forcing of SSL version like this:</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_SSLVERSION, 3);
  </code></pre>
  
  <p>Adding CURLOPT_SSLVERSION to the cURL connection made it ok. And then the root of my question:</p>
  
  <p>How do I force PHP soap constructor/call to use SSL3 as well. It seems to me that this would have to be the solution. But I haven't been able to find out how to set the PHP SOAP function to use SSL3 only. Since both commandline -openssl- and PHP cURL work with SSL3 forced, then I presume the same thing would happen with my SOAP-function?</p>
  
  <p>Inputs, please?</p>
  
  <p>(Using Ubuntu Linux, PHP 5.3.3)</p>