Script button click notifications not working suddenly

  • How can I check if my ASPN development certificate is working?

  • My python script gives the following error:

    Traceback (most recent call last):
      File "", line 15, in <module>
      File "build/bdist.macosx-10.9-intel/egg/APNSWrapper/", line 194, in notify
      File "build/bdist.macosx-10.9-intel/egg/APNSWrapper/", line 215, in connect
      File "build/bdist.macosx-10.9-intel/egg/APNSWrapper/", line 161, in connect
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 333, in connect
        self._real_connect(addr, False)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 323, in _real_connect
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 305, in do_handshake
    ssl.SSLError: [Errno 1] _ssl.c:504: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure

Any idea why?


source to share

1 answer

I managed to fix this by using TLSv1 instead of SSLv3 to establish a connection to the APNS server. The problem is that the python SSL library is linking to the legacy OpenSSL OSSS library (v0.9.8 on my machine). This version apparently no longer makes correct connections to the APNS server when using SSLv3. So instead of setting ssl_version, set PROTOCOL_TLSv1 like:

sock = socket()
sock = ssl.wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLSv1, certfile=certfile)
sock.connect((', 2195))


And you shouldn't get the handshake failure error anymore.



All Articles