SSLConfig handles the needed SSL information for establishing a DRbSSLSocket connection, including generating the X509 / RSA pair.

An instance of this config can be passed to, and DRbSSLSocket.open_server

See for more details


Default values for a SSLConfig instance.

See for more details

Class Methods

Create a new DRb::DRbSSLSocket::SSLConfig instance

The DRb::DRbSSLSocket will take either a config Hash or an instance of SSLConfig, and will setup the certificate for its session for the configuration. If want it to generate a generic certificate, the bare minimum is to provide the :SSLCertName

Config options

From config Hash:


An instance of OpenSSL::X509::Certificate. If this is not provided, then a generic X509 is generated, with a correspond :SSLPrivateKey


A private key instance, like OpenSSL::PKey::RSA. This key must be the key that signed the :SSLCertificate


An OpenSSL::X509::Certificate, or Array of certificates that will used as ClientCAs in the SSL Context


A path to the directory of CA certificates. The certificates must be in PEM format.


A path to a CA certificate file, in PEM format.


A DH callback. See OpenSSL::SSL::SSLContext.tmp_dh_callback


This is the minimum SSL version to allow. See OpenSSL::SSL::SSLContext#min_version=.


This is the maximum SSL version to allow. See OpenSSL::SSL::SSLContext#max_version=.


This is the SSL verification mode. See OpenSSL::SSL::VERIFY_* for available modes. The default is OpenSSL::SSL::VERIFY_NONE


Number of CA certificates to walk, when verifying a certificate chain.


A callback to be used for additional verification. See OpenSSL::SSL::SSLContext.verify_callback


A OpenSSL::X509::Store used for verification of certificates


Issuer name for the certificate. This is required when generating the certificate (if :SSLCertificate and :SSLPrivateKey were not given). The value of this is to be an Array of pairs:

[["C", "Raleigh"], ["ST","North Carolina"],

See also OpenSSL::X509::Name


A comment to be used for generating the certificate. The default is “Generated by Ruby/OpenSSL”


These values can be added after the fact, like a Hash.

require 'drb/ssl'
c = {}
c[:SSLCertificate] ='mycert.crt'))
c[:SSLPrivateKey] ='mycert.key'))
c[:SSLVerifyMode] = OpenSSL::SSL::VERIFY_PEER
c[:SSLCACertificatePath] = "/etc/ssl/certs/"


require 'drb/ssl'
c ={
        :SSLCertName => [["CN" => DRb::DRbSSLSocket.getservername]]
Instance Methods

A convenience method to access the values like a Hash

Accept connection to IO tcp, with context of the current certificate configuration

Connect to IO tcp, with context of the current certificate configuration

Ensures that :SSLCertificate and :SSLPrivateKey have been provided or that a new certificate is generated with the other parameters provided.

Establish the OpenSSL::SSL::SSLContext with the configuration parameters provided.