'Validate the APNS certificate at startup.'

def _validate_apns_certificate(self, certfile):

    try:
        with open(certfile, 'r') as f:
            content = f.read()
            check_apns_certificate(content)
    except Exception as e:
        msg = ('The    APNS    certificate    file    at    %r    is    not    readable:    %s' % (certfile, e))
        raise ImproperlyConfigured(msg)
