简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM