|
|
|
@ -8,15 +8,6 @@ setup_environment() { |
|
|
|
rm -r ${INSTALL_DIR}/.getssl |
|
|
|
fi |
|
|
|
|
|
|
|
if [ ! -f ${INSTALL_DIR}/pebble.minica.pem ]; then |
|
|
|
wget --quiet --no-clobber https://raw.githubusercontent.com/letsencrypt/pebble/master/test/certs/pebble.minica.pem 2>&1 |
|
|
|
CERT_FILE=/etc/ssl/certs/ca-certificates.crt |
|
|
|
if [ ! -f $CERT_FILE ]; then |
|
|
|
CERT_FILE=/etc/pki/tls/certs/ca-bundle.crt |
|
|
|
fi |
|
|
|
cat $CERT_FILE ${INSTALL_DIR}/pebble.minica.pem > ${INSTALL_DIR}/pebble-ca-bundle.crt |
|
|
|
fi |
|
|
|
|
|
|
|
curl --silent -X POST -d '{"host":"'"$GETSSL_HOST"'", "addresses":["'"$GETSSL_IP"'"]}' http://10.30.50.3:8055/add-a |
|
|
|
cp ${CODE_DIR}/test/test-config/nginx-ubuntu-no-ssl "${NGINX_CONFIG}" |
|
|
|
/getssl/test/restart-nginx |
|
|
|
@ -24,7 +15,7 @@ setup_environment() { |
|
|
|
|
|
|
|
|
|
|
|
cleanup_environment() { |
|
|
|
curl --silent -X POST -d '{"host":"'"$GETSSL_HOST"'", "addresses":["'"$GETSSL_IP"'"]}' http://10.30.50.3:8055/del-a |
|
|
|
curl --silent -X POST -d '{"host":"'"$GETSSL_HOST"'"}' http://10.30.50.3:8055/clear-a |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -42,3 +33,27 @@ create_certificate() { |
|
|
|
# shellcheck disable=SC2086 |
|
|
|
run ${CODE_DIR}/getssl $1 "$GETSSL_HOST" |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Find NGINX configuration directory for HTTP-01 testing (need to add SSL to config) |
|
|
|
if [[ -d /etc/nginx/conf.d/default.conf ]]; then |
|
|
|
export NGINX_CONFIG=/etc/nginx/conf.d/default.conf |
|
|
|
elif [[ -f /etc/nginx/sites-enabled/default ]]; then |
|
|
|
export NGINX_CONFIG=/etc/nginx/sites-enabled/default |
|
|
|
else |
|
|
|
echo "Can't find NGINX directory" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
# Find IP address |
|
|
|
export GETSSL_IP=$(ip address | awk '/10.30.50/ { print $2 }' | awk -F/ '{ print $1 }') |
|
|
|
|
|
|
|
if [ ! -f ${INSTALL_DIR}/pebble.minica.pem ]; then |
|
|
|
wget --quiet --no-clobber https://raw.githubusercontent.com/letsencrypt/pebble/master/test/certs/pebble.minica.pem 2>&1 |
|
|
|
CERT_FILE=/etc/ssl/certs/ca-certificates.crt |
|
|
|
if [ ! -f $CERT_FILE ]; then |
|
|
|
CERT_FILE=/etc/pki/tls/certs/ca-bundle.crt |
|
|
|
fi |
|
|
|
cat $CERT_FILE ${INSTALL_DIR}/pebble.minica.pem > ${INSTALL_DIR}/pebble-ca-bundle.crt |
|
|
|
fi |