Unable to fetch Movies - CERTIFICATE_VERIFY_FAILED

Hi All,

I am getting the below error on my browser when trying to navigate to mflix app through the url http://localhost:5000

Any once solved this issue before?

pymongo.errors.ServerSelectionTimeoutError: mflix-shard-00-00-zhapa.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056),mflix-shard-00-02-zhapa.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056),mflix-shard-00-01-zhapa.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)

Hi @Amr_96482,

Please share the content of your .ini file. Please refer this post and see if it resolves your issue.

If you’re using macOS then go to Macintosh HD > Applications > Python3.6 folder (or whatever version of python you’re using) > double click on “Install Certificates.command” file

Thanks,
Shubham Ranjan

Here is the .ini file content below, I also tried installing the certificates by running the below command but still not working

sudo pip3 install certifi

Moreover I am running Python 3.7 on Mac, but I couldn’t find the Macintosh HD > Applications > Python directory

#.ini File

[PROD]

SECRET_KEY = nuhguduq

MFLIX_DB_URI = mongodb://Amr:Amr123@mflix-shard-00-00-zhapa.mongodb.net:27017,mflix-shard-00-01-zhapa.mongodb.net:27017,mflix-shard-00-02-zhapa.mongodb.net:27017/test?ssl=true&replicaSet=mflix-shard-0&authSource=admin&retryWrites=true&w=majority

MFLIX_NS = sample_mflix

[TEST]

SECRET_KEY = nuhguduq

MFLIX_DB_URI = mongodb://Amr:Amr123@mflix-shard-00-00-zhapa.mongodb.net:27017,mflix-shard-00-01-zhapa.mongodb.net:27017,mflix-shard-00-02-zhapa.mongodb.net:27017/test?ssl=true&replicaSet=mflix-shard-0&authSource=admin&retryWrites=true&w=majority

MFLIX_NS = sample_mflix

I can connect to the mflix app using your URI.

  • Test your connection string using mongo shell and share the output:
    mongo "mongodb://Amr:Amr123@mflix-shard-00-00-zhapa.mongodb.net:27017,mflix-shard-00-01-zhapa.mongodb.net:27017,mflix-shard-00-02-zhapa.mongodb.net:27017/test?ssl=true&replicaSet=mflix-shard-0&authSource=admin&retryWrites=true&w=majority"
  • Upgrade pip and share the version number
1 Like