lib/puppet/network/authentication.rb
# Check the expiration of known certificates and optionally any that are specified as part of a request
Check the expiration of known certificates and optionally any that are specified as part of a request
Check the expiration of known certificates and optionally any that are specified as part of a request
def warn_if_near_expiration(*certs)
    certs << Puppet::SSL::CertificateAuthority.instance.host.certificate if Puppet::SSL::CertificateAuthority.ca?
    certs << Puppet::SSL::Host.localhost.certificate if FileTest.exist?(Puppet[:hostcert])
    certs.compact.each do |cert|
      cert = Puppet::SSL::Certificate.from_instance(cert) if cert.is_a?(OpenSSL::X509::Certificate)
      raise ArgumentError, "Invalid certificate '#{cert.inspect}'" unless cert.is_a?(Puppet::SSL::Certificate)
      if cert.near_expiration?
        @@logger.warning("Certificate '#{cert.unmunged_name}' will expire on #{cert.expiration.strftime('%Y-%m-%dT%H:%M:%S%Z')}")
      end
    end
  end
def warn_if_near_expiration ( * certs ) certs << Puppet :: SSL :: CertificateAuthority . instance . host . certificate if Puppet :: SSL :: CertificateAuthority . ca? certs << Puppet :: SSL :: Host . localhost . certificate if FileTest . exist? ( Puppet [ :hostcert ] ) certs . compact . each do | cert | cert = Puppet :: SSL :: Certificate . from_instance ( cert ) if cert . is_a? ( OpenSSL :: X509 :: Certificate ) raise ArgumentError , "Invalid certificate '#{cert.inspect}'" unless cert . is_a? ( Puppet :: SSL :: Certificate ) if cert . near_expiration? @@logger . warning ( "Certificate '#{cert.unmunged_name}' will expire on #{cert.expiration.strftime('%Y-%m-%dT%H:%M:%S%Z')}" ) end end end
Check the expiration of known certificates and optionally any that are specified as part of a request
Check the expiration of known certificates and optionally any that are specified as part of a request
# Check CA cert if we're functioning as a CA # Always check the host cert if we have one, this will be the agent or master cert depending on the run mode # Remove nil values for caller convenience # Allow raw OpenSSL certificate instances or Puppet certificate wrappers to be specified
certs
<not_specific>