mirror of
https://github.com/vee1e/bulk-questionnaire-upload.git
synced 2026-09-01 09:50:06 +00:00
fix: use certifi CA bundle to fix TLS handshake with MongoDB Atlas
tlsCAFile=certifi.where() is the correct pymongo parameter to supply the Mozilla CA bundle, resolving TLSV1_ALERT_INTERNAL_ERROR on both Python 3.11 and 3.14 when connecting to Atlas over TLS. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
29a6379370
commit
7dc8a65522
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from motor.motor_asyncio import AsyncIOMotorClient
|
||||
from pymongo import MongoClient
|
||||
import os
|
||||
import certifi
|
||||
from dotenv import load_dotenv
|
||||
from urllib.parse import quote_plus
|
||||
|
||||
|
|
@ -26,7 +27,7 @@ if not MONGODB_URL:
|
|||
else:
|
||||
MONGODB_URL = f"mongodb://{user}:{password_enc}@{host}/{DATABASE_NAME}"
|
||||
|
||||
async_client = AsyncIOMotorClient(MONGODB_URL)
|
||||
async_client = AsyncIOMotorClient(MONGODB_URL, tlsCAFile=certifi.where())
|
||||
database = async_client[DATABASE_NAME]
|
||||
|
||||
forms_collection = database.forms
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue