简体   繁体   中英

apple distribution certificate causes 14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure

I have created an iPhone app that support notifications, by following this tutorial by Ali Hafizji

when running in production I get the following error: 14094410:SSL routines:

SSL3_READ_BYTES:sslv3 alert handshake failure

itunes shows the distribution provisioning :

Enabled Services: Game Center, In-App Purchase, Push Notifications
Expires:Sep 15, 2015
Status:Active

I've loaded the pem file to the server and call it like so:

    theCertfile ='./CK_production.pem'
    theHost = ( 'gateway.push.apple.com', 2195 )
    ssl_sock = ssl.wrap_socket( socket.socket( socket.AF_INET, socket.SOCK_STREAM ), certfile = theCertfile )
    ssl_sock.connect( theHost )
    ssl_sock.write( theNotification )
    ssl_sock.close()

I understand Apple stopped using SSL 3.0 to send push notifications, and we need to use TSL instead the apple documentation doesn't have an example, can anyone point me to a tutorial, for Python/Django? (just to be clear I did google for a tutorial but didn't find one)

The reason is because Apple stopped using SSL 3.0 to send push notifications.

Why? A news published in late September 2014 said it was not secure anymore. Read Apple note

You can google "BEAST attack" for more information.

Now? Your service needs to use TLS. Here is Apple documentation

I had same issue, turned out that I was running the script with PHP command on my Mac terminal. Copied the files to my server and it is working now.

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