7

I am trying to create a python server that sends push notifications. I am using the pyAPNs module and when I try to connect to apple's server I get this error:

[Errno 336265225] _ssl.c:347: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib.

Anyone know what causes that? What format does the ssl cert have to be in? I tried .cer, but it gives me that error.

Bartzilla
  • 2,768
  • 4
  • 28
  • 37
Sam
  • 1,741
  • 5
  • 18
  • 22
  • See [this tutorial](http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/). Googling led me to it. – Moshe May 27 '11 at 20:41

1 Answers1

4

Documentation http://pypi.python.org/pypi/pyapns/0.3.0 says that certificate should be in PEM format. Remember that APNS authenticates client using Client Certificate, so private key is also required. Convert unencrypted private key to PEM format and concatenate with matching, PEM-encoded, certificate file. This works for other python APNS library - APNSWrapper.

mrk
  • 284
  • 3
  • 5