From 030405b93de1c7998522d6f4b9e5565a29734a94 Mon Sep 17 00:00:00 2001 From: Stefan Seemayer Date: Sun, 16 Oct 2016 15:58:08 +0200 Subject: [PATCH] Remove duplicate SSL hostnames Ref dokku/dokku-letsencrypt#76 Certificates provided by Let's Encrypt can have the domain provided in the Subject Name field listed again in the Subject Alt Name fields, leading to the same domain getting listed twice by get_ssl_hostnames() that in turn leads to a duplicate server_name field in the nginx configuration. This patch adds a sort -u to ensure that every SSL hostname will only be listed once. --- plugins/certs/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/certs/functions b/plugins/certs/functions index b64a14a56..a130c993e 100755 --- a/plugins/certs/functions +++ b/plugins/certs/functions @@ -26,6 +26,6 @@ get_ssl_hostnames() { else local SSL_HOSTNAMES=$SSL_HOSTNAME fi - echo -e "$SSL_HOSTNAMES" + echo -e "$SSL_HOSTNAMES" | sort -u return 0 }