@@ -23,6 +23,7 @@ function obtain_or_renew_certificate {
23
23
local eab=" ${8} "
24
24
local hmac=" ${9} "
25
25
local key_id=" ${10} "
26
+ local letsencrypt_key_type=" ${11:- } "
26
27
27
28
certificate_domain_opts=$( echo ${certificate_fqdns} | sed -r -e ' s/^/,/g' -e ' s/,/--domains=/g' -e ' s/--/ --/g' )
28
29
certificate_fqdn=$( echo ${certificate_fqdns} | awk -F ' ,' ' {print $1}' )
@@ -69,6 +70,7 @@ function obtain_or_renew_certificate {
69
70
70
71
log_info " [${certificate_fqdn} - cron] Obtaining certificate for domains ${certificate_fqdns} ."
71
72
mapfile -t cmd_output < <( /opt/lego --email=" ${mail} " \
73
+ $( [ -n " ${letsencrypt_key_type} " ] && echo " --key-type ${letsencrypt_key_type} " ) \
72
74
${certificate_domain_opts} \
73
75
--server " ${acme_url} " \
74
76
--path " /etc/letsencrypt/lego/${certificate_type} /" \
@@ -118,7 +120,7 @@ KEY_ID="NONE"
118
120
LOG_FILE=" /var/log/kolla/letsencrypt/lesencrypt-lego.log"
119
121
120
122
121
- VALID_ARGS=$( getopt -o ief:p:d:m:a:v:h: --long internal,external,fqdns:,port:,days:,mail:,acme:,vips:,haproxies-ssh:,eab,kid:,hmac: -- " $@ " )
123
+ VALID_ARGS=$( getopt -o ief:p:d:m:a:v:h:k: --long internal,external,fqdns:,port:,days:,mail:,acme:,vips:,haproxies-ssh:,eab,kid:,hmac:,key-type : -- " $@ " )
122
124
if [[ $? -ne 0 ]]; then
123
125
exit 1;
124
126
fi
@@ -176,6 +178,10 @@ while [ : ]; do
176
178
KEY_ID=" ${2} "
177
179
shift 2
178
180
;;
181
+ -k | --key-type)
182
+ LETSENCRYPT_KEY_TYPE=" ${2} "
183
+ shift 2
184
+ ;;
179
185
--) shift ;
180
186
break
181
187
;;
@@ -203,12 +209,12 @@ if [ "${INTERNAL_SET}" = "true" ] || [ "${EXTERNAL_SET}" = "true" ]; then
203
209
log_info " [${FQDN} - cron] This Letsencrypt-lego host is active..."
204
210
if [ " ${LETSENCRYPT_INTERNAL_FQDNS} " != " " ]; then
205
211
log_info " [${FQDN} - cron] Processing domains ${LETSENCRYPT_INTERNAL_FQDNS} "
206
- obtain_or_renew_certificate ${LETSENCRYPT_INTERNAL_FQDNS} internal ${PORT} ${DAYS} ${ACME} ${MAIL} ${LETSENCRYPT_SSH_PORT} ${EXTERNAL_ACCOUNT_BINDING} ${HMAC} ${KEY_ID}
212
+ obtain_or_renew_certificate ${LETSENCRYPT_INTERNAL_FQDNS} internal ${PORT} ${DAYS} ${ACME} ${MAIL} ${LETSENCRYPT_SSH_PORT} ${EXTERNAL_ACCOUNT_BINDING} ${HMAC} ${KEY_ID} ${LETSENCRYPT_KEY_TYPE}
207
213
fi
208
214
209
215
if [ " ${LETSENCRYPT_EXTERNAL_FQDNS} " != " " ]; then
210
216
log_info " [${FQDN} - cron] Processing domains ${LETSENCRYPT_EXTERNAL_FQDNS} "
211
- obtain_or_renew_certificate ${LETSENCRYPT_EXTERNAL_FQDNS} external ${PORT} ${DAYS} ${ACME} ${MAIL} ${LETSENCRYPT_SSH_PORT} ${EXTERNAL_ACCOUNT_BINDING} ${HMAC} ${KEY_ID}
217
+ obtain_or_renew_certificate ${LETSENCRYPT_EXTERNAL_FQDNS} external ${PORT} ${DAYS} ${ACME} ${MAIL} ${LETSENCRYPT_SSH_PORT} ${EXTERNAL_ACCOUNT_BINDING} ${HMAC} ${KEY_ID} ${LETSENCRYPT_KEY_TYPE}
212
218
fi
213
219
else
214
220
log_info " [${FQDN} - cron] This Letsencrypt-lego host is passive, nothing to do..."
0 commit comments