Skip to content

Instantly share code, notes, and snippets.

@manveru
Created October 28, 2016 21:15
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/1604cc053d50f208a553947c65e5911d to your computer and use it in GitHub Desktop.
Save manveru/1604cc053d50f208a553947c65e5911d 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")),
)
DRb.config[:SSLVerifyCallback] = ->(ok, _){ ok }
obj = DRbObject.new_with_uri('drbssl://localhost:1234')
p obj.size
require 'drb/ssl'
DRb.start_service(
'drbssl://localhost:1234',
{},
SSLCertName: [["CN", DRb::DRbSSLSocket.getservername]],
SSLCertificate: OpenSSL::X509::Certificate.new(File.read('pki/ca.crt')),
SSLVerifyMode: OpenSSL::SSL::VERIFY_PEER,
SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read('pki/private/ca.key')),
)
DRb.thread.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment