Skip to content

PYTHON-4572 - Fix type errors caused by new PyOpenSSL type hints #1743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pymongo/pyopenssl_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def load_cert_chain(
# Password callback MUST be set first or it will be ignored.
if password:

def _pwcb(_max_length: int, _prompt_twice: bool, _user_data: bytes) -> bytes:
def _pwcb(_max_length: int, _prompt_twice: bool, _user_data: Optional[bytes]) -> bytes:
# XXX:We could check the password length against what OpenSSL
# tells us is the max, but we can't raise an exception, so...
# warn?
Expand Down Expand Up @@ -332,6 +332,7 @@ def _load_certifi(self) -> None:
def _load_wincerts(self, store: str) -> None:
"""Attempt to load CA certs from Windows trust store."""
cert_store = self._ctx.get_cert_store()
assert cert_store is not None
oid = _stdlibssl.Purpose.SERVER_AUTH.oid

for cert, encoding, trust in _stdlibssl.enum_certificates(store): # type: ignore
Expand Down
Loading