Adithya Narayan
Adithya Narayan

Reputation: 65

Not able to connect to Atlas Cluster because of SSL Certificate Expired

I have an api using mongodb atlas as the database. It was working fine until one day it started throwing out this error:

pymongo.errors.ServerSelectionTimeoutError: cluster0-shard-00-00.gnqpe.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)

Here's the code invoking the database:

DB_URI='mongodb+srv://<username>:<password>@clusterdetails/databasename?retryWrites=true&w=majority'

from flask_mongoengine import MongoEngine

db = MongoEngine()

def initialize_db(app):    
    db.init_app(app)

I have been trying to fix this but haven't been successfull. Also noticed that mongoDB compass also takes forever to connect to the atlas cluster.

I am using windows10.

Upvotes: 0

Views: 436

Answers (0)

Related Questions