[英]Accessing Certificate and Key from AWS secrets manager to be used in Gunicorn configuration
I have store a ssl cert file and key file in AWS secrets manager.我在 AWS 机密管理器中存储了一个 ssl 证书文件和密钥文件。 I need to use those files for running gunicorn in HTTPS mode using following commnand:
我需要使用这些文件在 HTTPS 模式下使用以下命令运行 gunicorn:
gunicorn --certfile=server.crt --keyfile=server.key test:app gunicorn --certfile=server.crt --keyfile=server.key test:app
How can I access this?我怎样才能访问它?
If this is a certificate issued by AWS ACM, then you can't export the private key so you won't be able to use it like this.如果这是 AWS ACM 颁发的证书,那么您无法导出私钥,因此您将无法像这样使用它。 If this is a certificate issued by some other service that you have imported into AWS ACM, then you can get the key files with the
aws acm export-certificate
AWS CLI command .如果这是由您导入到 AWS ACM 中的某些其他服务颁发的证书,则您可以使用
aws acm export-certificate
AWS CLI 命令获取密钥文件。
You would have to run the AWS CLI command to export the certificate, then run the openssl
command also detailed in the documentation I linked to decrypt the private key, and save all that to the file system before running your gunicorn
command.您必须运行 AWS CLI 命令来导出证书,然后运行
openssl
命令(在我链接的文档中也有详细说明)以解密私钥,并在运行gunicorn
命令之前将所有内容保存到文件系统。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.