python - pass pem file,certificate and user to authenticate
问题描述
I am trying to authenticate with chef api. To authenticate with chef api i need to pass in pem file, user and certificate. How can i pass that using requests module.
Below is what i am trying
r = requests.get('https://example.com', cert=(cert_file,ca_file), auth=('user') )
I went through these documents https://2.python-requests.org//en/latest/user/advanced/#ssl-cert-verification
I know pychef is available to interact with chef server , but i want to do it through requests module . Can this be achieved ?
解决方案
try pychef by coderanger or you can get an inspiration from chef-api
推荐阅读
- multithreading - 使用windbg时如何设置当前线程
- java - Spring数据,通过嵌套对象的属性查找
- reactjs - 如何修复 react-native 中的 GET JSON 响应问题
- ios - 无法同时满足对 UITextField 的约束
- r - 如果没有可用的 UI 输入,则防止在 Shiny 中发生事件
- c# - 如何使用 Regex 和 C# 提取特定的 URL 段
- python - 检查目标时如何修复错误:预期activation_5有2维,但得到的数组具有形状(24943、50、50、1)
- azure - 如何阻止订阅所有者查看 keyvault 值
- node.js - 全局变量失去价值
- swift - Unexpected non-void return value in void function 错误,但函数设置为返回值