I have a problem with PyMongo and my raspberry pi.
When I am executing the below code I have different behaviors depending on if I run it on my laptop or on my Raspberry Pi:
import ssl
def insertDB():
import pymongo
from datetime import datetime
client = pymongo.MongoClient(
"mongodb+srv://******:*******@cluster0.nrs4u.mongodb.net/Cluster0?retryWrites=true&w=majority",
ssl_cert_reqs=ssl.CERT_NONE )
When I execute it on my laptop, it writes data into my database correctly. But, if I execute the same code on my raspberry pi. I get an error on ssl_cert_reqs=ssl.CERT_NONE
.
Note that PyMongo is installed on the raspberry. And even there is additional code, this one is not relevant for this problem.
Could you help me with this problem?
Solved the problem
import certifi
ca = certifi.where()
client = pymongo.MongoClient(
"mongodb+srv://******:*******@cluster0.nrs4u.mongodb.net/Cluster0?retryWrites=true&w=majority",
tlsCAFile = ca )