From ba2cd708bd1328f4e73b2be012dc0413666b0059 Mon Sep 17 00:00:00 2001 From: Casper Gielen Date: Sat, 30 Jan 2016 16:14:28 +0100 Subject: [PATCH 1/2] no www --- getssl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/getssl b/getssl index 8a10bdf..2117ed1 100755 --- a/getssl +++ b/getssl @@ -534,7 +534,7 @@ if [ ${_CREATE_CONFIG} -eq 1 ]; then info "creating domain config file in $DOMAIN_DIR/getssl.cfg" # if domain has an existsing cert, copy from domain and use to create defaults. EX_CERT=$(echo | openssl s_client -servername "${DOMAIN}" -connect "${DOMAIN}:443" 2>/dev/null | openssl x509 2>/dev/null) - EX_SANS="www.${DOMAIN}" + EX_SANS="" if [ ! -z "${EX_CERT}" ]; then if [ ! -f "$DOMAIN_DIR/${DOMAIN}.crt" ]; then echo "$EX_CERT" > "$DOMAIN_DIR/${DOMAIN}.crt" From 7cb3186f0917a67df2246fedd0b8c69267c5c199 Mon Sep 17 00:00:00 2001 From: Casper Gielen Date: Tue, 2 Feb 2016 18:40:35 +0100 Subject: [PATCH 2/2] configurable service port --- getssl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/getssl b/getssl index 2117ed1..90f3e08 100755 --- a/getssl +++ b/getssl @@ -54,6 +54,7 @@ SSLCONF="$(openssl version -d | cut -d\" -f2)/openssl.cnf" VALIDATE_VIA_DNS="" RELOAD_CMD="" RENEW_ALLOW="30" +PORT=443 PRIVATE_KEY_ALG="rsa" SERVER_TYPE="webserver" _USE_DEBUG=0 @@ -159,6 +160,10 @@ write_getssl_template() { # write out the main template file # an update to confirm correct certificate is running. #SERVER_TYPE="webserver" + # Port used by this service. + # Used for checking the existing certicate. + #PORT="443"" + # openssl config file. The default should work in most cases. SSLCONF="$SSLCONF" @@ -214,6 +219,10 @@ write_domain_template() { # write out a template file for a domain. # an update to confirm correct certificate is running. #SERVER_TYPE="webserver" + # Port used by this service. + # Used for checking the existing certicate. + #PORT="443"" + # Use the following 3 variables if you want to validate via DNS #VALIDATE_VIA_DNS="true" #DNS_ADD_COMMAND= @@ -533,7 +542,7 @@ if [ ${_CREATE_CONFIG} -eq 1 ]; then else info "creating domain config file in $DOMAIN_DIR/getssl.cfg" # if domain has an existsing cert, copy from domain and use to create defaults. - EX_CERT=$(echo | openssl s_client -servername "${DOMAIN}" -connect "${DOMAIN}:443" 2>/dev/null | openssl x509 2>/dev/null) + EX_CERT=$(echo | openssl s_client -servername "${DOMAIN}" -connect "${DOMAIN}:{$PORT}" 2>/dev/null | openssl x509 2>/dev/null) EX_SANS="" if [ ! -z "${EX_CERT}" ]; then if [ ! -f "$DOMAIN_DIR/${DOMAIN}.crt" ]; then