For connections using TLS/SSL, PyMongo may require third party dependencies as
determined by your version of Python. With PyMongo 3.3+, you can install
PyMongo 3.3+ and any TLS/SSL-related dependencies using the following pip
command:

$ python -m pip install pymongo[tls]

Earlier versions of PyMongo require you to manually install the dependencies
listed below.

By default, PyMongo is configured to require a certificate from the server when
TLS is enabled. This is configurable using the ssl_cert_reqs option. To
disable this requirement pass ssl.CERT_NONE as a keyword parameter:

In some cases you may want to configure PyMongo to use a specific set of CA
certificates. This is most often the case when using “self-signed” server
certificates. The ssl_ca_certs option takes a path to a CA file. It can be
passed as a keyword argument: