Skip to content

Commit b90765d

Browse files
authored
PYTHON-3865 add types to ssl_support.py (#1326)
1 parent f8b79a1 commit b90765d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

pymongo/ssl_support.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
"""Support for SSL in PyMongo."""
1616

17+
from typing import Optional
18+
1719
from pymongo.errors import ConfigurationError
1820

1921
HAVE_SSL = True
@@ -41,14 +43,14 @@
4143
BLOCKING_IO_ERRORS = _ssl.BLOCKING_IO_ERRORS
4244

4345
def get_ssl_context(
44-
certfile,
45-
passphrase,
46-
ca_certs,
47-
crlfile,
48-
allow_invalid_certificates,
49-
allow_invalid_hostnames,
50-
disable_ocsp_endpoint_check,
51-
):
46+
certfile: Optional[str],
47+
passphrase: Optional[str],
48+
ca_certs: Optional[str],
49+
crlfile: Optional[str],
50+
allow_invalid_certificates: bool,
51+
allow_invalid_hostnames: bool,
52+
disable_ocsp_endpoint_check: bool,
53+
) -> _ssl.SSLContext:
5254
"""Create and return an SSLContext object."""
5355
verify_mode = CERT_NONE if allow_invalid_certificates else CERT_REQUIRED
5456
ctx = _ssl.SSLContext(_ssl.PROTOCOL_SSLv23)

0 commit comments

Comments
 (0)