anvil icon indicating copy to clipboard operation
anvil copied to clipboard

cert-shifter not working with ecc certs. trivial name/directory pattern mismatch

Open tzauner opened this issue 4 years ago • 7 comments

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.

tzauner avatar Mar 21 '21 00:03 tzauner

Hmmm.

dlangille avatar Mar 21 '21 00:03 dlangille

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....

dlangille avatar Mar 21 '21 15:03 dlangille

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
$ 

dlangille avatar Mar 21 '21 16:03 dlangille

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
$ 

dlangille avatar Mar 21 '21 16:03 dlangille

I created a new branch with the changes. I have not tested them. Are you comfortable testing them at your location?

dlangille avatar Mar 21 '21 17:03 dlangille

Evening. Yes, I will get the branch an test it within next days and will let you know.

tzauner avatar Mar 21 '21 20:03 tzauner

Evening. Yes, I will get the branch an test it within next days and will let you know.

Any news?

dlangille avatar Oct 18 '21 13:10 dlangille