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

update-ca-trust overwrites /etc/pki/java/cacerts #27

Closed
ktreese opened this issue May 24, 2017 · 4 comments
Closed

update-ca-trust overwrites /etc/pki/java/cacerts #27

ktreese opened this issue May 24, 2017 · 4 comments

Comments

@ktreese
Copy link

ktreese commented May 24, 2017

For Red Hat 7 installations, it appears that the invocation of update-ca-trust overwrites /etc/pki/java/cacerts, which occurs during the Exec[enable_ca_trust]

Debug: Exec[enable_ca_trust](provider=posix): Executing check 'update-ca-trust check | grep DISABLED'
Debug: Executing: 'update-ca-trust check | grep DISABLED'

To illustrate this from the command line:

~ # keytool -importcert -noprompt -alias java -file /opt/conf/test.pem -keystore /etc/pki/java/cacerts -trustcacerts
Enter keystore password:  
Certificate was added to keystore
~ # keytool -list -keystore /etc/pki/java/cacerts -alias java
Enter keystore password:  
java, May 24, 2017, trustedCertEntry, 
Certificate fingerprint (SHA1): B2:6A:3C:22:CC:49:4B:EF:2F:27:51:74:0F:F9:4F:B6:E1:4F:3G:E3
~ # update-ca-trust check | grep DISABLED
~ # keytool -list -keystore /etc/pki/java/cacerts -alias java
Enter keystore password:  
keytool error: java.lang.Exception: Alias <java> does not exist

This plays havoc while attempting to use https://github.com/puppetlabs/puppetlabs-java_ks:

    java_ks { 'java:cacerts':
      ensure       => latest,
      certificate  => '/opt/conf/test.pem',
      target       => '/etc/pki/java/cacerts',
      password     => 'changeit',
      trustcacerts => true,
      require      => File['/opt/conf/test.pem'],
    }

I understand Red Hat 7 is not inclusive of the supported platforms, but thought some awareness should be raised on this one. Thank you!

@h0tw1r3
Copy link

h0tw1r3 commented Jun 6, 2017

@ktreese This is not specific to RHEL 7. update-ca-trust is a intended to completely manage all ca stores (java included). Essentially this module does everything java_ks does. Mixing the two will never work.

@ktreese
Copy link
Author

ktreese commented Jun 13, 2017

Thank you @h0tw1r3. Perhaps I'm missing it, but how would one go about including a cert within a specific java keystore, and pass in the password?

@alexjfisher
Copy link
Member

alexjfisher commented Feb 28, 2018

@ktreese See #38 for why enable_ca_trust is updating your certs.

@ktreese
Copy link
Author

ktreese commented Mar 17, 2018

@alexjfisher Thanks!

@ktreese ktreese closed this as completed May 14, 2021
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

3 participants