Using PyMongo with MongoDB Atlas

    Connections to Atlas require TLS/SSL. For connections using TLS/SSL, PyMongomay 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-relateddependencies using the following pip command:

    Earlier versions of PyMongo require you to manually install the dependencies.For a list of TLS/SSL-related dependencies, see .

    Note

    Connecting to Atlas “Free Tier” or “Shared Cluster” instancesrequires Server Name Indication (SNI) support. SNI support requires CPython2.7.9 / PyPy 2.5.1 or newer. To check if your version of Python supportsSNI run the following command:

    Warning

    Industry best practices recommend, and some regulations require,the use of TLS 1.1 or newer. Though no application changes are required forPyMongo to make use of the newest protocols, some operating systems orversions may not provide an OpenSSL version new enough to support them.

    Users of macOS older than 10.13 (High Sierra) will need to install Pythonfrom python.org, , macports, or another similar source.

    Users of Linux or other non-macOS Unix can check their OpenSSL version likethis:

    You can check your Python interpreter by installing the moduleand executing the following command:

    You should see “TLS 1.X” where X is >= 1.

    You can read more about TLS versions and their security implications here:

    https://www.owasp.org/index.php/TransportLayer_Protection_Cheat_Sheet#Rule-_Only_Support_Strong_Protocols