Class: DRb::DRbSSLSocket
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Inherits: |
DRb::DRbTCPSocket
|
Defined in: | lib/drb/ssl.rb |
Overview
Class Method Summary
-
.new(uri, soc, config, is_established) ⇒ DRbSSLSocket
constructor
Create a
DRbSSLSocket
instance. -
.open(uri, config)
Return an
DRbSSLSocket
instance as a client-side connection, with the SSL connected. -
.open_server(uri, config)
Returns a
DRbSSLSocket
instance as a server-side connection, with the SSL connected.
Constructor Details
.new(uri, soc, config, is_established) ⇒ DRbSSLSocket
Create a DRbSSLSocket
instance.
DRb.uri is the URI we are connected to. soc
is the tcp socket we are bound to. DRb.config is our configuration. Either a Hash or DRbSSLSocket::SSLConfig is_established
is a boolean of whether soc
is currently established
This is called automatically based on the ::DRb protocol.
Class Method Details
.open(uri, config)
Return an DRbSSLSocket
instance as a client-side connection, with the SSL connected. This is called from DRb.start_service or while connecting to a remote object:
DRb.start_service 'drbssl://localhost:0', front, config
DRb.uri is the URI we are connected to, 'drbssl://localhost:0'
above, DRb.config is our configuration. Either a Hash or DRbSSLSocket::SSLConfig
.open_server(uri, config)
Returns a DRbSSLSocket
instance as a server-side connection, with the SSL connected. This is called from DRb.start_service or while connecting to a remote object:
DRb.start_service 'drbssl://localhost:0', front, config
DRb.uri is the URI we are connected to, 'drbssl://localhost:0'
above, DRb.config is our configuration. Either a Hash or DRbSSLSocket::SSLConfig
# File 'lib/drb/ssl.rb', line 268
def self.open_server(uri, config) uri = 'drbssl://:0' unless uri host, port, = parse_uri(uri) if host.size == 0 host = getservername soc = open_server_inaddr_any(host, port) else soc = TCPServer.open(host, port) end port = soc.addr[1] if port == 0 @uri = "drbssl://#{host}:#{port}" ssl_conf = SSLConfig.new(config) ssl_conf.setup_certificate ssl_conf.setup_ssl_context self.new(@uri, soc, ssl_conf, false) end