grafana/loki · error · LogStash::ConfigurationError

Unsupported private key type '#{@key.class}''

Error message

Unsupported private key type '#{@key.class}''

What it means

Error "Unsupported private key type '#{@key.class}''" thrown in grafana/loki.

Source

Thrown at clients/cmd/logstash/lib/logstash/outputs/loki.rb:149

          send(@batch)
          @batch = nil
        end
      end
    end
  end

  def ssl_cert?
    !@key.nil? && !@cert.nil?
  end

  def load_ssl
    @cert = OpenSSL::X509::Certificate.new(File.read(@cert)) if @cert
    @key = OpenSSL::PKey.read(File.read(@key)) if @key
  end

  def validate_ssl_key
    if !@key.is_a?(OpenSSL::PKey::RSA) && !@key.is_a?(OpenSSL::PKey::DSA)
      raise LogStash::ConfigurationError, "Unsupported private key type '#{@key.class}''"
    end
  end

  def ssl_opts(uri)
    opts = {
      use_ssl: uri.scheme == 'https'
    }

     # disable server certificate verification
    if @insecure_skip_verify
      opts = opts.merge(
        verify_mode: OpenSSL::SSL::VERIFY_NONE
      )
    end

    if !@cert.nil? && !@key.nil?
      opts = opts.merge(
        verify_mode: OpenSSL::SSL::VERIFY_PEER,

View on GitHub (pinned to 24cfedd4f6)

When it happens

Trigger: Thrown at clients/cmd/logstash/lib/logstash/outputs/loki.rb:149 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/loki@24cfedd4f6 (2026-08-15). Data as JSON: /api/errors/d2286e5d90955160. Report an issue: GitHub.