将pem文件、证书和用户传递给authenti

2024-10-16 17:22:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试通过chef api进行身份验证。要使用chefapi进行身份验证,我需要传入pem文件、用户和证书。如何使用requests模块传递该请求

下面是我正在尝试的

r = requests.get('https://example.com', cert=(cert_file,ca_file), auth=('user') )

我看了这些文件 https://2.python-requests.org//en/latest/user/advanced/#ssl-cert-verification

我知道pychef可以和chef服务器交互,但我想通过requests模块来实现。这能实现吗


Tags: 模块文件用户https身份验证apigetcert