PyAPNs
PyAPNs copied to clipboard
Certificate server verification
Hello,
From a security point of view, it is better to check the server certificate, at least its certificate signature with:
self._ssl = wrap_socket(self._socket, keyfile=self.key_file, certfile=self.cert_file, ca_certs=cacertfile)
Where cacertfile comes from https://www.entrust.net/downloads/binary/entrust_2048_ca.cer. It could be downloaded and included into PyAPNs package.
Even better checking the APN gateway certificate validity by checking the CRL or the OCSP, but I do not think that Python SSL library handle this easily...