title: Send Apple Notification Service A Message With Python
body: <p>I am following the documentation given with the following pyAPNS library:
  <a href="https://github.com/djacobs/PyAPNs" rel="noreferrer">https://github.com/djacobs/PyAPNs</a></p>
  
  <pre><code>apns = APNs(use_sandbox=True, cert_file='ThePushCertificate.pem', key_file='ThePushKey.pem')
  payload = Payload(alert="Checking if it works", sound="default", badge=1)
  apns.gateway_server.send_notification(some_string, payload)
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <p><strong>SSLError: [Errno 1] _ssl.c:504: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure</strong></p>
  
  <p>This error occurs on the last line of code displayed above.</p>
  
  <p><strong>What does this error mean? How do I fix this?</strong></p>
  
  <p>PS. I have been stuck on this for a couple of hours now.I found 1 similar question on here, but the answer did not really help me (for my situation). I will continue to try to figure out what's going wrong, I just felt it might be helpful if I get help from more advanced iOS / Python developers over here. Thanks!</p>
  
  <hr>
  
  <p>After another day of trying to get it to work, I am stuck with a new error:</p>
  
  <pre><code>SSL_CTX_use_PrivateKey_file:PEM lib
  </code></pre>
  
  <p>I also went through the tutorial suggested in the answer below numerous times, but that did not help unfortunately. In the tutorial, a new combined PEM file is used, but with the repo's documentation, that file is not used, does anyone know how I should use that file?</p>