Sha256: 89c692f9c3378a39fc368a6e6e70a827ea9add725d6bc0f8dec54b8042d08003

Contents?: true

Size: 457 Bytes

Versions: 3

Compression:

Stored size: 457 Bytes

Contents

module Thin
  module Backends
    class Base
      attr_accessor :ca_cert
    end
  end

  class Connection < EventMachine::Connection
    def ssl_verify_peer cert
      client = OpenSSL::X509::Certificate.new cert
      store.verify client
    end


    private
    def store
       @store ||= OpenSSL::X509::Store.new.tap do |store|
         root = OpenSSL::X509::Certificate.new backend.ca_cert
         store.add_cert root
       end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
grenache-ruby-http-0.2.13 lib/grenache/http/http_server.rb
grenache-ruby-http-0.2.12 lib/grenache/http/http_server.rb
grenache-ruby-http-0.2.11 lib/grenache/http/http_server.rb