我在连接到 Cosmos DB 时收到 SSL 错误 ( SSL: CERTIFICATE_VERIFY_FAILED )。我的 cosmos DB 存在于本地网络中,我正在从 ubuntu 机器运行我的 python 脚本。
下面是我的代码:
from pydocumentdb import document_client
print('START----------------------')
uri = 'https://10.107.0.111:8081'
key = 'MY_KEY'
client = document_client.DocumentClient(uri, {'masterKey': key})
db_id = 'MY_ID'
db_query = "select * from r where r.id = '{0}'".format(db_id)
db = list(client.QueryDatabases(db_query))[0]
下面是我收到的 ssl 错误:
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='10.107.0.111', port=8081): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),))
寻求帮助和感谢。