Comment 62 for bug 965371

Revision history for this message
Will Bradley (bradley-will) wrote :

Congratulations, all! This consumed ~20 hours of time isolating and fixing a bug in what's supposed to be 6-month-old "LTS" release. I see it's supposedly got a fix released and triaged, but the milestone is 6 months old and Colin doesn't seem sure if this is still an issue. I can confirm it is on the two 12.04 machines I have access to and am happy to do further troubleshooting or supply sample scripts if necessary.

There are unfortunately few workarounds for those (two?) of us trying to use SoapClient in PHP. The above fixes work for me, but don't handle PHP's SoapClient, and it was quite a journey triaging that.

I finally got the below PHP code to work for my use case, which is communicating with remote SSL SOAP services that only support SSLv2, SSLv3, or TLS1.0 (and not TLS 1.1, TLS 1.2) especially using RC4-SHA ciphers. The ciphers option in a new stream_context is the necessary bit to make the code work on 12.04:

  $opts = array(
    'ssl' => array('ciphers'=>'RC4-SHA')
  );

  ini_set( "soap.wsdl_cache_enabled", "0" );
  $objSoapClient = new SoapClient(
    'https://EXAMPLE.COM/EXAMPLEWSDLPATH',
    array ( "encoding"=>"ISO-8859-1",
    'stream_context' => stream_context_create($opts),
    "trace"=>1,
    "exceptions"=>0,
    "connection_timeout"=>2000 ));

The trick is to substitute SoapClient's normal context with your own context + SSL options: http://www.php.net/manual/en/soapclient.soapclient.php
http://www.php.net/manual/en/context.php
http://www.php.net/manual/en/function.stream-context-create.php

This site was invaluable in testing what exact ciphers/technologies are actually supported by the remote server: https://www.ssllabs.com/ssltest/index.html