ruby/rubygems · error · Gem::Security::Exception

#{message} not valid after #{not_after}

Error message

#{message} not valid after #{not_after}

What it means

Error "#{message} not valid after #{not_after}" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/security/policy.rb:98

  end

  ##
  # Ensures that +signer+ is valid for +time+ and was signed by the +issuer+.
  # If the +issuer+ is +nil+ no verification is performed.

  def check_cert(signer, issuer, time)
    raise Gem::Security::Exception, "missing signing certificate" unless
      signer

    message = "certificate #{signer.subject}"

    if (not_before = signer.not_before) && not_before > time
      raise Gem::Security::Exception,
            "#{message} not valid before #{not_before}"
    end

    if (not_after = signer.not_after) && not_after < time
      raise Gem::Security::Exception, "#{message} not valid after #{not_after}"
    end

    if issuer && !signer.verify(issuer.public_key)
      raise Gem::Security::Exception,
            "#{message} was not issued by #{issuer.subject}"
    end

    true
  end

  ##
  # Ensures the public key of +key+ matches the public key in +signer+

  def check_key(signer, key)
    unless signer && key
      return true unless @only_signed

      raise Gem::Security::Exception, "missing key or signature"

View on GitHub (pinned to 86cbb817a3)

Solutions

  1. The certificate has expired; renew/re-issue it and re-sign the gem
  2. For your own gems: `gem cert --re-sign` or build a new certificate

When it happens

Trigger: Thrown at lib/rubygems/security/policy.rb:98 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/9c0e666b00ec290f. Report an issue: GitHub.