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

SSL Certificate error

Open alfcar62 opened this issue 2 years ago • 3 comments

I'm a beginner of Python and MongoDB but I have tried your code and it works perfecty on local MongoDB. If i try to access to the same database on Atlas Cloud and in tis case occurrs the error "SSL Certificate invalid". I've tried but i don't know how to resolve it.

alfcar62 avatar Feb 26 '23 15:02 alfcar62

I'm a beginner of Python and MongoDB but I have tried your code and it works perfecty on local MongoDB.

If i try to access to the same database on Atlas Cloud and in tis case occurrs the error "SSL Certificate invalid".

I've tried but i don't know how to resolve it.

Hi, are you using Mac or Windows? If you are using Mac after the installation of Python on your system you must execute the code "Install Certificate.comand" is inside the installation folder, otherwise any connection that uses SSL will generate an error.

yoandysse avatar Mar 18 '23 11:03 yoandysse

I'm a beginner of Python and MongoDB but I have tried your code and it works perfecty on local MongoDB.

If i try to access to the same database on Atlas Cloud and in tis case occurrs the error "SSL Certificate invalid".

I've tried but i don't know how to resolve it.

Hi, are you using Mac or Windows? If you are using Mac after the installation of Python on your system you must execute the code "Install Certificate.comand" is inside the installation folder, otherwise any connection that uses SSL will generate an error.

yoandysse avatar Mar 18 '23 11:03 yoandysse

I got the same issue.

I have solved: change main.py import ssl

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