ctx = SSL.Context()
ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, depth=9)
x509_store = ctx.get_cert_store()
x509_store.add_x509(CACertObject)
m2.ssl_ctx_use_x509(ctx.ctx, CertObject)
m2.ssl_ctx_use_pkey_privkey(ctx.ctx, PrivateKeyObject)
m2.ssl_ctx_check_privkey(ctx.ctx)
_ssl = SSL.Connection(ctx)
_ssl.connect((self._host, self._port))
sock = _ssl.socket