title: Can't establish secured connection with SOAP unistream
body: <p>I have problem with interaction with Unistream service by SOAP-client and by curl too.</p>
  
  <p>My environment: Ubuntu 15.04, php 5.64</p>
  
  <p>Some history: unistream's support asked us generate certifiate:
  makecert.exe -n "CN=some_name" -ss My -r -m 120 -pe -sky exchange -a sha1, then export by mmc end send certificate to them. Ok, we do this and got certificate generated on their side.
  I convert their certificate to pem-format and try use is php SoapClient:</p>
  
  <pre><code>    $soap = new SoapClient("http://test2.unistream.com:82/wcflib-tc/service.svc?wsdl", [
      'encoding' =&gt; 'UTF-8',
      'trace' =&gt; true,
      'local_cert' =&gt; $cert_path,
      'soap_version' =&gt; SOAP_1_2,
      'connection_timeout' =&gt; 180,
      'cache_wsdl' =&gt; WSDL_CACHE_NONE
  ]);
  $data = $soap-&gt;GetCountriesChanges(['requestMessage'=&gt;[
          'AuthenticationHeader'=&gt;[
              'AppKey'=&gt;'*',
              'Password'=&gt;'*',
              'Username'=&gt;'*',
          ],
          'UpdateCount'=&gt;1000
      ]]);
  </code></pre>
  
  <p>And i got nothing. I try the same with python soap library, with soapui and got nothing too, timeout.
  Ok, i look it with wireshark, and saw that soap client recieve all xsd schemas and etc and then connection interrupt after post request to url: <a href="http://test2.unistream.com:82/wcflib-tc/service.svc" rel="nofollow">http://test2.unistream.com:82/wcflib-tc/service.svc</a>, just timeout. And i saw only plain http with xml, no packets with ssl.
  Ok, i try send post-request on this url:</p>
  
  <pre><code>ini_set('default_socket_timeout', 30);
  $request_string =
      '&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
                xmlns:ns1="http://schemas.datacontract.org/2004/07/WcfServiceLib"
                xmlns:ns2="http://schemas.datacontract.org/2004/07/WcfServiceLib.Utils"
                xmlns:ns3="http://schemas.datacontract.org/2004/07/WcfServiceLib.Dictionaries.Country"
                xmlns:ns4="http://test.unistream.com/wcflib/"&gt;
      &lt;env:Body&gt;
          &lt;ns4:GetCountriesChanges&gt;
              &lt;ns4:requestMessage&gt;
                  &lt;ns2:AuthenticationHeader&gt;
                      &lt;ns1:AppKey&gt;*&lt;/ns1:AppKey&gt;
                      &lt;ns1:Password&gt;*&lt;/ns1:Password&gt;
                      &lt;ns1:Username&gt;*&lt;/ns1:Username&gt;
                  &lt;/ns2:AuthenticationHeader&gt;
                  &lt;ns3:UpdateCount&gt;1000&lt;/ns3:UpdateCount&gt;
              &lt;/ns4:requestMessage&gt;
          &lt;/ns4:GetCountriesChanges&gt;
      &lt;/env:Body&gt;
  &lt;/env:Envelope&gt;
  ';
  
  $url = 'http://test2.unistream.com:82/wcflib-tc/service.svc';
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/soap+xml;', 'Charset=utf-8']);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_CAPATH, "/path");
  //my cert
  curl_setopt($ch, CURLOPT_SSLCERT, "/path/local_cert.pem");
  //my private key
  curl_setopt($ch, CURLOPT_SSLKEY, "/path/local_key.pem");
  curl_setopt($ch, CURLOPT_SSLKEYPASSWD, 'passwd');
  //api's cert
  curl_setopt($ch, CURLOPT_CAINFO, '/path/api_cert.cer'); 
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $request_string);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
  curl_setopt($ch, CURLOPT_CERTINFO, true);
  curl_setopt($ch, CURLOPT_VERBOSE, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  $result = curl_exec($ch);
  print_r($result);
  echo "\n";
  $error = curl_error($ch);
  print_r($error);
  echo "\n";
  </code></pre>
  
  <p>And i get xml with error: "An error occurred when verifying security for the message."
  If i try send request to url: <a href="https://test2.unistream.com:82/wcflib-tc/service.svc" rel="nofollow">https://test2.unistream.com:82/wcflib-tc/service.svc</a> i got plain html with error 400 and curl error: "error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol"</p>
  
  <p>Support can't help me. They said "we have 10000 working clients, we consult only about high-level api problems and bussines-logic".</p>
  
  <p>Can somebody give me right direction?</p>