現在、コードで SSL クライアント側証明書を使用しています。AWS SSM から証明書を読み取り、それらをどこかの一時ファイルに書き込んで、そのファイルをリクエスト ライブラリに渡す必要があります。
# read the cert and key from SSM and write to './client.cert' and './client.key' respectively
requests_session = requests.Session()
# send a request with SSL certificate
response = requests_session.post(url, headers=REQUEST_HEADER, json=request_body, timeout=TIMEOUT_IN_SECONDS,
cert=('./client.cert', './client.key'))
SSL キーと証明書をローカル ファイルに書き込まないようにする方法を見つけようとしています。誰かがこの点で助けてくれれば、本当に感謝しています。だから最終的にはこんなものが欲しい。
# read the cert and key from SSM
key = SSM.CLIENT_KEY
cert = SSM.CLIENT_CERT
requests_session = requests.Session()
# send a request with SSL certificate
response = requests_session.post(url, headers=REQUEST_HEADER, json=request_body, timeout=TIMEOUT_IN_SECONDS,
cert=(cert, key))