What about just importing `CertificateError` from `from .connection import ( ...` below rather than duplicating this block? IMO same in the tests.