ruby/rubygems · error · CertificateFailureError

17

17

Error message

Could not verify the SSL certificate for #{remote_uri}.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see https://railsapps.github.io/openssl-certificate-verify-failed.html.

What it means

Error "Could not verify the SSL certificate for #{remote_uri}. There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see https://railsapps.github.io/openssl-certificate-verify-failed.html." thrown in ruby/rubygems.

Source

Thrown at lib/bundler/fetcher/index.rb:13

# frozen_string_literal: true

require_relative "base"

module Bundler
  class Fetcher
    class Index < Base
      def specs(_gem_names)
        Bundler.rubygems.fetch_all_remote_specs(remote, gem_remote_fetcher)
      rescue Gem::RemoteFetcher::FetchError => e
        case e.message
        when /certificate verify failed/
          raise CertificateFailureError.new(display_uri)
        when /401/
          raise BadAuthenticationError, remote_uri if remote_uri.userinfo
          raise AuthenticationRequiredError, remote_uri
        when /403/
          raise AuthenticationForbiddenError, remote_uri
        else
          raise HTTPError, "Could not fetch specs from #{display_uri} due to underlying error <#{e.message}>"
        end
      end
    end
  end
end

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/fetcher/index.rb:13 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


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