File: openssl_loader.rb

package info (click to toggle)
puppet-agent 7.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,092 kB
  • sloc: ruby: 245,074; sh: 456; makefile: 38; xml: 33
file content (24 lines) | stat: -rw-r--r-- 693 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require_relative '../../puppet/util/platform'

# This file should be required instead of writing `require 'openssl'`
# or any library that loads openssl like `net/https`. This allows the
# core Puppet code to load correctly in JRuby environments that do not
# have a functioning openssl (eg a FIPS enabled one).

unless Puppet::Util::Platform.jruby_fips?
  require 'openssl'
  require 'net/https'
else
  # Even in JRuby we need to define the constants that are wrapped in
  # Indirections: Puppet::SSL::{Key, Certificate, CertificateRequest}
  module OpenSSL
    module PKey
      class RSA; end
    end

    module X509
      class Request; end
      class Certificate; end
    end
  end
end