title: curl error 35, possible reasons?
body: <p>The trouble showed itself yesterday - getting following answer from curl (called in php script by curl_exec):</p>
  
  <pre><code>$&lt;errno&gt;35&lt;/errno&gt;
  $&lt;error&gt;Unknown SSL protocol error in connection to w3s.webmoney.ru:443 &lt;/error&gt;
  </code></pre>
  
  <p>That bug happens only sometimes, something around 4-5 valid responses to one invalid with 35 error. Before yesterday application was handling those requests correctly for a very long time. </p>
  
  <p>Hope someone will give me a hint about possible reasons of that bug.</p>
  
  <p>P.S. We are suffering from internet connection problems lately, can it be somehow connected to that bug? </p>
  
  <p><strong>Upd:</strong>
  Setting verbose output to true made curl to write following log:</p>
  
  <pre><code>* About to connect() to w3s.webmoney.ru port 443 (#0)
  *   Trying 82.198.171.158... * connected
  * Connected to w3s.webmoney.ru (82.198.171.158) port 443 (#0)
  * successfully set certificate verify locations:
  *   CAfile: ${path}/WebMoneyCA.crt
    CApath: /etc/ssl/certs
  * SSL connection using RC4-MD5
  * Server certificate:
  *        subject: C=RU; O=WebMoney Transfer; OU=WebMoney Web Service; CN=w3s.webmoney.ru
  *        start date: 2010-06-07 10:03:43 GMT
  *        expire date: 2012-06-07 10:13:43 GMT
  *        common name: w3s.webmoney.ru (matched)
  *        issuer: OU=WM Transfer Certification Services; O=WM Transfer Ltd; CN=WebMoney Transfer Root CA
  *        SSL certificate verify ok.
  &gt; POST /asp/XMLPurses.asp HTTP/1.1
  Host: w3s.webmoney.ru
  Accept: */*
  Content-Length: 281
  Content-Type: application/x-www-form-urlencoded
  
  &lt; HTTP/1.1 200 OK
  &lt; Date: Fri, 10 Dec 2010 13:00:04 GMT
  &lt; Server: Microsoft-IIS/6.0
  &lt; X-Powered-By: ASP.NET
  &lt; Content-Length: 4423
  &lt; Content-Type: text/xml; Charset=windows-1251
  &lt; Expires: Fri, 10 Dec 2010 13:00:04 GMT
  &lt; Set-Cookie: ASPSESSIONIDQADQDTAQ=FJMNECHBENFFAADHEHPFOKAE; path=/
  &lt; Cache-control: private
  &lt;
  * Connection #0 to host w3s.webmoney.ru left intact
  * Closing connection #0
  * About to connect() to w3s.webmoney.ru port 443 (#0)
  *   Trying 212.158.173.158... * connected
  * Connected to w3s.webmoney.ru (212.158.173.158) port 443 (#0)
  * successfully set certificate verify locations:
  *   CAfile: ${path}/WebMoneyCA.crt
    CApath: /etc/ssl/certs
  * Unknown SSL protocol error in connection to w3s.webmoney.ru:443
  * Closing connection #0
  </code></pre>
  
  <p><strong>Upd</strong>: 
  The trouble was not on our side. The problem was hidden somewhere in w3s.webmoney.ru, in 212.158.173.158 server. I'll add more details about the bug if information will be available.</p>