16 |
SSLCONFIG="${SSLCONFIG-${SSLDIR}/openssl.cnf}" |
SSLCONFIG="${SSLCONFIG-${SSLDIR}/openssl.cnf}" |
17 |
CERTDIR="${SSLDIR}/certs" |
CERTDIR="${SSLDIR}/certs" |
18 |
KEYDIR="${SSLDIR}/private" |
KEYDIR="${SSLDIR}/private" |
19 |
CERTNAME="mcore" |
CERTNAME="mcored" |
20 |
CERTFILE="${CERTDIR}/${CERTNAME}.pem" |
CERTFILE="${CERTDIR}/${CERTNAME}.pem" |
21 |
KEYFILE="${KEYDIR}/${CERTNAME}.key" |
KEYFILE="${KEYDIR}/${CERTNAME}.key" |
22 |
|
|
27 |
[ -f ${CERTFILE} ] && die "${CERTFILE} already exists, won't overwrite!" |
[ -f ${CERTFILE} ] && die "${CERTFILE} already exists, won't overwrite!" |
28 |
[ -f ${KEYFILE} ] && die "${KEYFILE} already exists, won't overwrite!" |
[ -f ${KEYFILE} ] && die "${KEYFILE} already exists, won't overwrite!" |
29 |
|
|
30 |
openssl req -new -x509 -nodes -config ${SSLCONFIG} -out ${CERTFILE} -keyout ${KEYFILE} -days 365 || die "Certificate request failed!" |
openssl req -new -x509 -sha1 -nodes -config ${SSLCONFIG} -out ${CERTFILE} -keyout ${KEYFILE} -days 365 || die "Certificate request failed!" |
31 |
openssl x509 -subject -fingerprint -noout -in ${CERTFILE} || die "Fingerprint failed!" |
openssl x509 -sha1 -subject -fingerprint -noout -in ${CERTFILE} || die "Fingerprint failed!" |