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

Check if certificates work with current passphrase #42

Open
widhalmt opened this issue Feb 3, 2023 · 4 comments
Open

Check if certificates work with current passphrase #42

widhalmt opened this issue Feb 3, 2023 · 4 comments
Assignees
Labels
feature New feature or request
Milestone

Comments

@widhalmt
Copy link
Member

widhalmt commented Feb 3, 2023

When changing a certificates passphrase it will be changed in the configuration using the certificate but not on the certificate itself. We need to implement a check whether the certificate works with the current passphrase or not. If not, we need to regenerate it (maybe keeping a backup of the old one).

Please refer to #41 , #40 and #35 so all the changes will work together.

@widhalmt widhalmt added the feature New feature or request label Feb 3, 2023
@widhalmt widhalmt modified the milestones: 1.0.0, 1.1.0 Feb 3, 2023
@danopt
Copy link
Member

danopt commented May 2, 2023

Checking passphrases should be possible, but we can't be sure if the file is corrupted or the passphrase is wrong. I guess that wouldn't be a big problem, because in both cases the certificates should be regenerated.

Currently, if the passphrase is wrong or the certificate is corrupted, the cert_info module will fail with a ValueError exception. We can catch the exception and return the result of the check without failing the module.

Here is a test case for a wrong passphrase: https://github.com/NETWAYS/ansible-collection-elasticstack/actions/runs/4818065211/jobs/8579587032#step:6:84

@widhalmt Do you see any problems if the module can't difference between invalid PKCS12 data or a wrong passphrase?

@widhalmt
Copy link
Member Author

Nope, no problem at all. Please go for it.

@danopt danopt self-assigned this Aug 21, 2023
@danopt
Copy link
Member

danopt commented Aug 21, 2023

Alright 👍

@danopt
Copy link
Member

danopt commented Aug 28, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants