Class: T2Server::ClientAuthSSLConnectionParameters

Inherits:
DefaultConnectionParameters show all
Defined in:
lib/t2-server/net/parameters.rb

Overview

Connection parameters that simplify setting up client authentication to a server over SSL.

Constant Summary

Constants inherited from ConnectionParameters

T2Server::ConnectionParameters::ALLOWED_PARAMS

Instance Method Summary collapse

Methods inherited from ConnectionParameters

#[]=

Constructor Details

#initialize(cert, password = nil) ⇒ ClientAuthSSLConnectionParameters

:call-seq:

new(certificate, password = nil) -> ClientAuthSSLConnectionParameters

certificate should point to a file with the client user’s certificate and private key. The key will be unlocked with password if it is encrypted. If password is not specified, but needed, then the underlying SSL implementation may ask for it if it can.



149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/t2-server/net/parameters.rb', line 149

def initialize(cert, password = nil)
  super

  case cert
  when String
    self[:client_certificate] = cert
  when File
    self[:client_certificate] = cert.path
  end

  self[:client_password] = password
end