djacobs / PyAPNs

Python library for interacting with the Apple Push Notification service (APNs)
http://pypi.python.org/pypi/apns/
MIT License
1.22k stars 374 forks source link

passphrase issue #40

Closed armance closed 10 years ago

armance commented 10 years ago

When I run my script on local but it blocks and prompts me to enter the passphrase manually and doesn't work until I do

I don't know how to set it up so to work without prompt

This is my code:

            from apns import APNs, Payload
            import optparse
            import os

            certificate_file = here(".." + app.fichier_PEM.url   )        
            token_hex = '0c99bb3d077eeacdc04667d38dd10ca1a'
            pass_phrase = app.mot_de_passe

            apns = APNs(use_sandbox=True, cert_file= certificate_file)
            payload = Payload(alert = message.decode('utf-8'), sound="default", badge=1)
            apns.gateway_server.send_notification(token_hex, payload)

            # Get feedback messages
            for (token_hex, fail_time) in apns.feedback_server.items():
                print "fail: "+fail_time
polavishnu4444 commented 10 years ago

Hey did you get out of the problem?? Please help me, I too am facing the same.

djacobs commented 10 years ago

This is expected behavior, not a bug. If you don't want to have to use a password, than you can do so by using a key that doesn't require one. More here: http://www.openssl.org/docs/apps/openssl.html

armance commented 10 years ago

But I have to use a password!! what can I do then?

DokRaphael commented 6 years ago

For those who were wondering how to do it Generate a decrypted key by typing :

openssl rsa -in aps_dev_key.pem -out aps_dev_key_decrypted.pem

and use this one instead of aps_dev_key.pem Cheers