anvil
anvil copied to clipboard
cert-shifter not working with ecc certs. trivial name/directory pattern mismatch
THe ecc certs issues from acme.sh have a cifferent naming scheme. the directory name is /var/db/acme/certs/example.com_ecc/ but the cert name is example.com.cer and NOT example.com_ecc.cer.
I think this can be fixed very easy IF acme.sh sticks to this naming scheme.
Hmmm.
https://github.com/dlangille/anvil/blob/master/cert-shifter#L41 is the culprit I think.
If we have another check, for pulling _ecc off the directory name....
1st test
[dan@empty:~] $ /bin/sh
$ dir=/var/db/acme/certs/example.com_ecc/
$ foo=$(basename $dir)
$ echo $foo
example.com_ecc
$ ECC_SUFFX="_ecc"
$ echo $ECC_SUFFX
_ecc
$ bar=${foo%"$ECC_SUFFX"}
$ echo $bar
example.com
$
2nd test
[dan@empty:~] $ /bin/sh
$ dir=/var/db/acme/certs/example.com/
$ foo=$(basename $dir)
$ echo $foo
example.com
$ ECC_SUFFX="_ecc"
$ echo $ECC_SUFFX
_ecc
$ bar=${foo%"$ECC_SUFFX"}
$ echo $bar
example.com
$
I created a new branch with the changes. I have not tested them. Are you comfortable testing them at your location?
Evening. Yes, I will get the branch an test it within next days and will let you know.
Evening. Yes, I will get the branch an test it within next days and will let you know.
Any news?