-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[2018.3.4] x509.certificate_managed comparisons fail on py3 #52180
Comments
I'm not seeing these type differences. I am seeing differences in the Subject Hash and Issuer Hash which show up only under python3. |
I think the problem is the order of the subject elements. While this happened to always be in the same order in python2, it appears to be in a non-deterministic order in python3, which changes the subject hash. |
No, all the actual values (including those hashes) I get are the same.
|
Interesting, I'm not seeing the same thing on 2019.2 Python 3.5.2. |
This seems to be a duplicate of #52026. |
If of interest, I fixed it locally with a custom state module. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
The function now displays clearer error messages when a problem occurs and informative messages when comparing an existing certificate. test=True is now supported. It fixes saltstack#52180, saltstack#39608, saltstack#41858 and others: * Error messages from the x509 module calls are written directly to the certificate file - fixed, the certificate file is only created when the x509 module calls succeed. * Certificates are created when no changes are required - fixed, the comparison logic has been updated. The `managed_private_key` option has been removed due to the added complexity. The functionality can easily be replicated with an additional call to `x509.private_key_managed`. According to the comment at saltstack#39608 (comment) `managed_private_key` has not worked since at least v2016.11.2.
After some debugging why it always replaced the certificate, I have identified two type differences between
current_comp
andnew_comp
.https://github.com/saltstack/salt/blob/v2018.3.4/salt/states/x509.py#L526
In
new_comp
, "Public Key" is astr
but incurrent_comp
it isbytes
.In
new comp
, "X509v3 Extensions" is adict
but incurrent_comp
it isOrderedDict
Probably related: #50680
The text was updated successfully, but these errors were encountered: