more style/function tweaks
This commit is contained in:
committed by
Michael Hobbs
parent
89f289b433
commit
aa2415eeb8
@@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
is_ssl_enabled() {
|
||||
local desc="returns 0 if ssl is enabled for given app"
|
||||
local APP=$1; verify_app_name "$APP"
|
||||
APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
if [[ -e "$APP_SSL_PATH/server.crt" ]] && [[ -e "$APP_SSL_PATH/server.key" ]]; then
|
||||
return 0
|
||||
|
||||
@@ -23,11 +23,11 @@ certs_info_cmd() {
|
||||
dokku_log_info2 "Issuer: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Issuer:" | xargs | sed -e "s/Issuer: //g")"
|
||||
dokku_log_info2 "Starts At: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Not Before:" | awk -F ": " '{ print $2 }')"
|
||||
dokku_log_info2 "Subject: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -subject | sed -e "s:subject= ::g"| sed -e "s:^/::g" | sed -e "s:/:; :g")"
|
||||
SSL_VERIFY_OUTPUT="$(openssl verify -verbose -purpose sslserver "$APP_SSL_PATH/server.crt" | awk -F ':' '{ print $2 }' | tail -1 | xargs || true)"
|
||||
local SSL_VERIFY_OUTPUT="$(openssl verify -verbose -purpose sslserver "$APP_SSL_PATH/server.crt" | awk -F ':' '{ print $2 }' | tail -1 | xargs || true)"
|
||||
if [[ "$SSL_VERIFY_OUTPUT" == "OK" ]]; then
|
||||
SSL_SELF_SIGNED="verified by a certificate authority."
|
||||
local SSL_SELF_SIGNED="verified by a certificate authority."
|
||||
else
|
||||
SSL_SELF_SIGNED="self signed."
|
||||
local SSL_SELF_SIGNED="self signed."
|
||||
fi
|
||||
dokku_log_info2 "SSL certificate is $SSL_SELF_SIGNED"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user