occlum/demos/python/flask/gen-cert.sh
2023-04-18 13:12:37 +08:00

17 lines
399 B
Bash
Executable File

#!/bin/bash
pushd ~
openssl rand -writerand .rnd
popd
# Generate self-signed key/cert
# Generate valid Flask server Key/Cert
openssl genrsa -out flask.key 2048
openssl req -nodes -new -key flask.key -subj "/CN=localhost" -out flask.csr
openssl x509 -req -sha256 -days 365 -in flask.csr -signkey flask.key -out flask.crt
# Remove passphrase from the Key
openssl rsa -in flask.key -out flask.key