forked from acidprime/puppet-catalog-diff
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for custom certificates to old PuppetDB
This implementation is based on a suggestion from Josh Cooper: ``` Yeah can use https://www.rubydoc.info/gems/puppet/Puppet/X509/CertProvider to load x509 certificates and then create a custom ssl context using https://www.rubydoc.info/gems/puppet/Puppet/SSL/SSLProvider, and pass it into any of the http client methods, e.g. x509 = Puppet::X509::CertProvider.new cacerts = x509.load_cacerts_from_pem(File.read('...', encoding: Encoding::UTF_8)) prov = Puppet::SSL::Provider.new ctx = prov.create_context(cacerts: cacerts, revocation: false, ...) response = Puppet.runtime[:http].get(URI('https://...', options: { ssl_context: ctx }) ``` Slack link: https://puppetcommunity.slack.com/archives/C0W1X7ZAL/p1652464163822119?thread_ts=1652453262.819079&cid=C0W1X7ZAL
- Loading branch information
1 parent
53c1d53
commit 3d31368
Showing
4 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters