pymongo-fastapi-crud icon indicating copy to clipboard operation
pymongo-fastapi-crud copied to clipboard

Error connection certificate

Open rubik12023 opened this issue 2 years ago • 1 comments

Hi,

I am trying to connect but I get a certificate error:

I have solved: main.py

app.mongodb_client = MongoClient(config["ATLAS_URI"], ssl=True, ssl_cert_reqs=ssl.CERT_NONE)
app.database = app.mongodb_client[config["DB_NAME"]]

rubik12023 avatar Jun 20 '23 15:06 rubik12023

Hi,

I am trying to connect but I get a certificate error:

I have solved: main.py

app.mongodb_client = MongoClient(config["ATLAS_URI"], ssl=True, ssl_cert_reqs=ssl.CERT_NONE)
app.database = app.mongodb_client[config["DB_NAME"]]

Yes. This resolve the problem, but i don't recommend it for code in production.

I recomend you https://github.com/mongodb-developer/pymongo-fastapi-crud/issues/1#issuecomment-1474819318

And try install pymongo[srv]

yoandysse avatar Jun 22 '23 20:06 yoandysse