Skip to content

Instantly share code, notes, and snippets.

@manveru
Created October 28, 2016 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manveru/156c959d5b8820d9b0e0e9c5732614fd to your computer and use it in GitHub Desktop.
Save manveru/156c959d5b8820d9b0e0e9c5732614fd to your computer and use it in GitHub Desktop.
require 'drb/ssl'
DRb.start_service
DRb.config.merge!(
SSLVerifyMode: OpenSSL::SSL::VERIFY_PEER,
SSLCACertificateFile: 'pki/ca.crt',
SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read('client/pki/private/ManveruClient.key')),
SSLCertificate: OpenSSL::X509::Certificate.new(File.read('pki/issued/ManveruClient.crt')),
)
obj = DRbObject.new_with_uri('drbssl://localhost:1234')
p obj.size
require 'drb/ssl'
DRb.start_service(
'drbssl://localhost:1234',
{},
SSLVerifyMode: OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT,
SSLCACertificateFile: 'pki/ca.crt',
SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read('pki/private/ca.key')),
SSLCertificate: OpenSSL::X509::Certificate.new(File.read('pki/ca.crt')),
SSLVerifyCallback: ->(ok, c){ ok },
)
DRb.thread.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment