Method: EventMachine::Connection#start_tls
- Defined in:
- lib/em/connection.rb
#start_tls(args = {}) ⇒ Object
TODO:
support passing an encryption parameter, which can be string or Proc, to get a passphrase
TODO:
support passing key material via raw strings or Procs that return strings instead of
Call #start_tls at any point to initiate TLS encryption on connected streams. The method is smart enough to know whether it should perform a server-side or a client-side handshake. An appropriate place to call #start_tls is in your redefined #post_init method, or in the #connection_completed handler for an outbound connection.
for encrypted private keys. just filenames.
406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/em/connection.rb', line 406 def start_tls args={} priv_key, cert_chain, verify_peer = args.values_at(:private_key_file, :cert_chain_file, :verify_peer) [priv_key, cert_chain].each do |file| next if file.nil? or file.empty? raise FileNotFoundException, "Could not find #{file} for start_tls" unless File.exists? file end EventMachine::set_tls_parms(@signature, priv_key || '', cert_chain || '', verify_peer) EventMachine::start_tls @signature end |