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

Switching CA does not regenerate certs #39

Open
c33s opened this issue Jan 12, 2022 · 2 comments
Open

Switching CA does not regenerate certs #39

c33s opened this issue Jan 12, 2022 · 2 comments

Comments

@c33s
Copy link

c33s commented Jan 12, 2022

i would have opened a discussion if they where enabled in this git repo. i am not sure if i simply do something wrong or if i found a bug.

for the development i created the certificates with the ca letsencrypt_test. this worked quite well, just needed some puppet runs and the certificate was correctly there. after that i switched to the ca letsencrypt but the certificates where still from the test ca. i wasn't able to force a regeneration of the cert.
so i tried to delete the complete acme folder from the client but after the puppet run the i got wrong certs again. also tried to delete the folder on server and client which led me to an unusable system (not exactly in this order, i played around a bit) as "suddenly" the private key doesn't match the cert any more.

Jan 10 02:25:09 aio001 nginx[932050]: nginx: [emerg] SSL_CTX_use_PrivateKey("/etc/acme.sh/keys/.../private.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
Jan 10 02:25:09 aio001 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE

am i doing something wrong? should this module be able to switch ca's? how can i start-over? how to force regeneration?

@NikkelCoin
Copy link

Any update on this? I'm stuck on this aswell

@fraenki
Copy link
Member

fraenki commented Sep 12, 2023

Unfortunately, this is currently not supported. In order to recover from this situation, run the following on both the Puppetserver and the affected Node:
https://github.com/markt-de/puppet-acme#rebuilding-nodes

In order to support changing CA for existing certs, it would be necessary to add this information to the name of every file that is used by acme.sh:

(I consider this a bug, because it is an unexpected result. However, the module was not designed for this in the first place, so in reality this is a somewhat complicated feature request.)

@fraenki fraenki changed the title [ question / documentation / bug? ] switching ca from test to prod does not regenerate certs Switching CA does not regenerate certs Sep 12, 2023
@fraenki fraenki added the bug label Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants