21 lines
540 B
Bash
21 lines
540 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||
|
set -x
|
||
|
fi
|
||
|
|
||
|
cert_file="/app/tls/statechannels.org.pem"
|
||
|
key_file="/app/tls/statechannels.org_key.pem"
|
||
|
|
||
|
# Check if the cert already exists
|
||
|
if [ -f "$cert_file" ] ; then
|
||
|
echo "Cert file ${cert_file} already exists"
|
||
|
else
|
||
|
echo "Creating certs"
|
||
|
mkcert -cert-file $cert_file -key-file $key_file statechannels.org localhost 127.0.0.1 $CERC_NITRO_PUBLIC_RPC_HOST ::1
|
||
|
|
||
|
# Copy over the rootCA cert so that it can be used by the client
|
||
|
cp -r $(mkcert -CAROOT)/* /app/mkcert-caroot
|
||
|
fi
|