Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

send push notifications to iphone from python

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.

like image 506
Sam Avatar asked May 27 '11 20:05

Sam


1 Answers

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.

like image 187
mrk Avatar answered Sep 30 '22 17:09

mrk