title: error with stream_socket_client
body: <p>Why am I getting this errors:</p>
  
  <blockquote>
    <p>Warning: stream_socket_client(): SSL operation failed with code 1.
    OpenSSL Error messages: error:14094410:SSL
    routines:SSL3_READ_BYTES:sslv3 alert handshake failure</p>
    
    <p>Warning: stream_socket_client(): Failed to enable crypto </p>
    
    <p>Warning: stream_socket_client(): unable to connect to
    ssl://gateway.sandbox.push.apple.com:2195 (Unknown error)
    Failed to connect: 0</p>
  </blockquote>
  
  <p>I am sending this php page with a cron job and the code error is referring to this:</p>
  
  <pre><code>$fp = stream_socket_client(
  'ssl://gateway.sandbox.push.apple.com:2195', $err,
  $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
  </code></pre>
  
  <p>Which is very strange because the exact same code is on another two php pages and it works perfectly.</p>
  
  <p>I also copied and pasted the exact same code from one page where it was working to a brand new one and it didn't work... I don't see how that can make sense!</p>