Skip to content

Commit 4669fb4

Browse files
authored
Give up on typing
1 parent 4ecec8b commit 4669fb4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/trustme/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,14 +545,13 @@ def configure_cert(self, ctx: Union[ssl.SSLContext, OpenSSL.SSL.Context]) -> Non
545545
with self.private_key_and_cert_chain_pem.tempfile() as path:
546546
ctx.load_cert_chain(path)
547547
elif _smells_like_pyopenssl(ctx):
548-
octx = cast("OpenSSL.SSL.Context", ctx)
549548
key = load_pem_private_key(self.private_key_pem.bytes(), None)
550-
octx.use_privatekey(key)
549+
ctx.use_privatekey(key) # type: ignore[arg-type]
551550
cert = x509.load_pem_x509_certificate(self.cert_chain_pems[0].bytes())
552-
octx.use_certificate(cert)
551+
ctx.use_certificate(cert) # type: ignore[arg-type]
553552
for pem in self.cert_chain_pems[1:]:
554553
cert = x509.load_pem_x509_certificate(pem.bytes())
555-
octx.add_extra_chain_cert(cert)
554+
ctx.add_extra_chain_cert(cert) # type: ignore[arg-type]
556555
else:
557556
raise TypeError(
558557
"unrecognized context type {!r}".format(ctx.__class__.__name__)

0 commit comments

Comments
 (0)