Python AWS Lambda Certificates

允我心安 提交于 2021-02-07 19:49:43

问题


How do I add an additional CA (certificate authority) to the trust store used by my Python3 AWS Lambda function?


回答1:


If you only need a single CA, then get your crt file and encode it into a pem using the following command in linux:

openssl x509 -text -in "{your CA}.crt" > cacert.pem

If you need to add CA's to the default CA bundle, then copy python3.8/site-packages/certifi/cacert.pem to your lambda folder. Then run this command for each crt:

openssl x509 -text -in "{your CA}.crt" >> cacert.pem

After creating the pem file, deploy your lambda with the REQUESTS_CA_BUNDLE environment variable set to /var/task/cacert.pem.

/var/task is where AWS Lambda extracts your zipped up code to.



来源:https://stackoverflow.com/questions/56225178/python-aws-lambda-certificates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!