Unverified Commit 92d85346 authored by Matt Pryor's avatar Matt Pryor Committed by GitHub
Browse files

Merge pull request #93 from ESGF/issue/89/openssl-random-state

Fixes #89.
parents 5bcfe387 53a72b1d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -18,9 +18,14 @@ set -eo pipefail
[ -z "$ESGF_HOSTNAME" ] && error "ESGF_HOSTNAME must be set"

CERTS="/esg/certificates"
mkdir -p "$CERTS"

info "Generating self-signed test certificates"

# Create a temporary directory to use as HOME
# This is required to allow openssl to produce its random state
export HOME="$(mktemp -d)"

if [ ! -f "$CERTS/slcsca/ca.crt" ]; then
    : ${ESGF_SLCS_CA_SUBJECT:="/O=esgf/CN=$ESGF_HOSTNAME SLCS CA"}
    info "Creating self-signed CA for the SLCS with subject = $ESGF_SLCS_CA_SUBJECT"