Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank SANS leads to unnecessary CSR recreation #191

Closed
cederberg opened this issue Dec 11, 2016 · 2 comments
Closed

Blank SANS leads to unnecessary CSR recreation #191

cederberg opened this issue Dec 11, 2016 · 2 comments

Comments

@cederberg
Copy link

cederberg commented Dec 11, 2016

Upon the first 30-day cert renewal, my cron logs printed these messages:

Check all certificates
existing csr at /etc/getssl/SERVER/SERVER.csr does not have the same domains as the config - re-create-csr
creating domain csr - /etc/getssl/SERVER/SERVER.csr
...

Since neither the DOMAIN nor SANS had been modified, this shouldn't be needed. Both the old and new CSR files are identical, and the output of the openssl req -text -noout -in ... command returns a single line:

SERVER

The issue seems to originate from the $alldomains variable on line 422:

alldomains=$(echo "$DOMAIN,$SANS" | sed -e 's/ //g; y/,/\n/' | sort -u)

The output here includes an empty line if SANS is empty:

$> DOMAIN="SERVER"
$> SANS=""
$> echo "$DOMAIN,$SANS" | sed -e 's/ //g; y/,/\n/' | sort -u

SERVER

A bugfix for this might be to change the sed command above to sed -e 's/ //g; s/,$//; y/,/\n/'.

@cederberg cederberg changed the title 30-day renewal leads to unnecessary CSR recreation Blank SANS leads to unnecessary CSR recreation Dec 11, 2016
@srvrco
Copy link
Collaborator

srvrco commented Dec 11, 2016

Many thanks, I hadn't spotted that bug ( I think nearly all mine have a SANS variable set)

@srvrco
Copy link
Collaborator

srvrco commented Dec 11, 2016

Updated in version 1.85 , thanks

@srvrco srvrco closed this as completed Dec 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant