简体   繁体   中英

Python AWS Lambda Certificates

如何向 Python3 AWS Lambda 函数使用的信任存储添加额外的 CA(证书颁发机构)?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM