pymongo-fastapi-crud
pymongo-fastapi-crud copied to clipboard
SSL Certificate error
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.
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.
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.
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"]