def get_current_cert(self): """ Get current X.509 certificate. @warning: The returned certificate is NOT refcounted, so you can not rely on it being valid once the store context goes away or is modified. """ return X509(m2.x509_store_ctx_get_current_cert(self.ctx), _pyfree=0)