cyberark / conjur-puppet

Official Puppet module for CyberArk Conjur
https://forge.puppet.com/cyberark/conjur
Apache License 2.0
6 stars 3 forks source link

Fix v6 server-side use of missing APIs #91

Closed izgeri closed 4 years ago

izgeri commented 4 years ago

When running the e2e smoketest with Puppet v6 server, we get 500 errors.

Running e2e and monitoring the server container logs, error can be seen here:

2020-06-25 20:02:55,317 ERROR [p.r.core] Internal Server Error: org.jruby.exceptions.NotImplementedError: (NotImplementedError) NotImplementedError
        at RUBY.create_session(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/http/external_client.rb:77)
        at RUBY.initialize(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/ssl/state_machine.rb:376)
        at RUBY.certificate(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/ssl/host.rb:126)
        at RUBY.localhost(/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/ssl/host.rb:28)
        at RUBY.decrypt(/etc/puppetlabs/code/environments/production/modules/conjur/lib/puppet/functions/conjur/decrypt.rb:11)

in this block of code: https://github.com/cyberark/conjur-puppet/blob/v2.0.3/lib/puppet/functions/conjur/decrypt.rb#L11

Relevant block:

  def decrypt pkcs7
    host = Puppet::SSL::Host.localhost
    key = host.key.content
    certificate = host.certificate.content
    decryptor = OpenSSL::PKCS7.new pkcs7
    sensitive.new decryptor.decrypt key, certificate
  end