SSL:连接到 cosmos DB 时出现 CERTIFICATE_VERIFY_FAILED

问题描述 投票:0回答:1

我在连接到 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)'),))

寻求帮助和感谢。

python database ssl ssl-certificate azure-cosmosdb
1个回答
0
投票

@sachhya 和@renato-ramos-nascimento。你能详细回答一下吗?我正在尝试使用 python 连接到 cosmos db。

url = "url"
key = "key"
client = CosmosClient(url, key)

SSL Error description is given here

© www.soinside.com 2019 - 2024. All rights reserved.