title: Cannot complete SSL handshake with gateway.push.apple.com using perl IO::Socket::SSL
body: <p>I am very new to this type of thing and not sure what I am doing wrong.</p>
  
  <p>Inside Mojolicious app, I am battling to connect to the Apple Push Notification SSL Socket. I would like to send a push notification to an app.</p>
  
  <p>Debug Information:</p>
  
  <pre><code>DEBUG: .../IO/Socket/SSL.pm:2700: new ctx 138351632
  DEBUG: .../IO/Socket/SSL.pm:612: socket not yet connected
  DEBUG: .../IO/Socket/SSL.pm:614: socket connected
  DEBUG: .../IO/Socket/SSL.pm:636: ssl handshake not started
  DEBUG: .../IO/Socket/SSL.pm:669: using SNI with hostname gateway.push.apple.com
  DEBUG: .../IO/Socket/SSL.pm:704: request OCSP stapling
  DEBUG: .../IO/Socket/SSL.pm:736: call Net::SSLeay::connect
  DEBUG: .../IO/Socket/SSL.pm:2601: did not get stapled OCSP response
  DEBUG: .../IO/Socket/SSL.pm:2554: ok=0 [1] /O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification     Authority (2048)/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C
  DEBUG: .../IO/Socket/SSL.pm:739: done Net::SSLeay::connect -&gt; -1
  DEBUG: .../IO/Socket/SSL.pm:742: SSL connect attempt failed
  DEBUG: .../IO/Socket/SSL.pm:742: local error: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
  DEBUG: .../IO/Socket/SSL.pm:745: fatal SSL error: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
  DEBUG: ...5.18/IO/Socket.pm:48: ignoring less severe local error 'IO::Socket::IP configuration failed', keep 'SSL connect attempt failed error:14090086:SSL     routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed'
  DEBUG: .../IO/Socket/SSL.pm:2733: free ctx 138351632 open=138351632
  DEBUG: .../IO/Socket/SSL.pm:2738: free ctx 138351632 callback
  DEBUG: .../IO/Socket/SSL.pm:2745: OK free ctx 138351632
  </code></pre>
  
  <p>Code snip bit:</p>
  
  <pre><code>use IO::Socket::SSL qw(debug3);
  
  my $cl = IO::Socket::SSL-&gt;new(
    PeerHost =&gt; 'gateway.push.apple.com',
    # PeerHost =&gt; 'gateway.sandbox.push.apple.com',
    PeerPort =&gt; '2195',
    SSL_verify_mode =&gt; SSL_VERIFY_PEER,
    SSL_ca_file =&gt; '/var/www/foo/bar/cert/ck.pem',
  );
  </code></pre>
  
  <p>I'm not sure where to go or what to do from here?</p>