Sha256: 6327f6847917f776fb7031110f52b636d34770ff159a55c4c5841dd494b09bf9

Contents?: true

Size: 805 Bytes

Versions: 3

Compression:

Stored size: 805 Bytes

Contents

#!/usr/bin/env ruby

require 'drb'
require 'drb/ssl'

require_client_cert = true
here = ARGV.shift || "drbssl://localhost:3456"

class HelloWorld
  include DRbUndumped

  def hello(name)
    "Hello, #{name}."
  end
end

config = Hash.new
config[:verbose] = true
config[:SSLPrivateKey] = OpenSSL::PKey::RSA.new File.read("uriel_keypair.pem")
config[:SSLCertificate] =
  OpenSSL::X509::Certificate.new File.read("cert_uriel.pem")

if require_client_cert then
  config[:SSLVerifyMode] = OpenSSL::SSL::VERIFY_PEER |
                           OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT
  config[:SSLCACertificateFile] = "cacert.pem"
  config[:SSLVerifyCallback] = proc do |ok, store|
    p [ok, store.error_string]
    ok
  end
end

DRb.start_service(here, HelloWorld.new, config)
puts DRb.uri
DRb.thread.join

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
IOWA-1.0.3 utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_s.rb
IOWA-1.0.2 utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_s.rb
IOWA-1.0.0 utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_s.rb