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

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

Open
tzauner opened this issue Mar 21, 2021 · 7 comments

Comments

@tzauner
Copy link

tzauner commented Mar 21, 2021

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.

@dlangille
Copy link
Owner

Hmmm.

@dlangille
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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 added a commit that referenced this issue Mar 21, 2021
While here, use $(..) instead of `..`

I have not tested this.
@dlangille
Copy link
Owner

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

@tzauner
Copy link
Author

tzauner commented Mar 21, 2021

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

@dlangille
Copy link
Owner

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

Any news?

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

2 participants