calendarserver.push.applepush.APNProviderFactory Connection to APN server lost: [Failure instance: Traceback: : [(‘SSL routines’, ‘SSL3_READ_BYTES’, ‘ssl handshake failure’)]

The following error was being logged on OS X Server (10.9.x) with calendar server in use, in /var/log/caldavd/error.log:

“caldavĀ  [APNProviderProtocol (TLSMemoryBIOProtocol),client] [calendarserver.push.applepush.APNProviderFactory#info] Connection to APN server lost: [Failure instance: Traceback: <class ‘OpenSSL.SSL.Error’>: [(‘SSL routines’, ‘SSL3_READ_BYTES’, ‘ssl handshake failure’)]”

Before proceeding, ensure that you have a known-good, working SSL certificate. I’m using a commercial (purchased, not self-signed) certificate.

In my case, the following steps to remedied the above error:

Verify your ssl cert setup (I’m using a commercial one).

In Server.app, click on Calendar, and under “Settings” look for Push Notifications: Enabled
Hit the Edit button.

Use the Renew button in the pop-up dialog box, even if your current push certificate isn’t expired.
Stay in that same pop-up dialog, and click the arrow beside the bottom-most (small) text in grey, “Manage your certificates.” Log into Apple’s Push Certificates Portal,
and revoke any old expired certs. Heed the warnings stated there !

Back in the Server app, click on the very top item in the left-hand colum, your server name (eg: server) and UN-check the last check-box for “Enable Apple push notifications.”
Wait a full 30 seconds.
Check (click on, enable) that same box to enable Apple push notifications.

Check your log (tail -f /var/log/caldavd/error.log) and the errors should now be gone.