Method: Libuv::TCP#start_tls
- Defined in:
- lib/libuv/tcp.rb
#start_tls(args = {}) ⇒ Object
TLS Abstraction ———————-
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/libuv/tcp.rb', line 53 def start_tls(args = {}) return self unless @connected && @tls.nil? args[:verify_peer] = true if @on_verify @handshake = false @pending_writes = [] .merge!(args) hosts = [:hosts] if hosts && hosts[0] opts = .merge(hosts[0]) @tls = ::RubyTls::SSL::Box.new(opts[:server], self, opts) hosts[1..-1].each do |host_opts| @tls.add_host(**host_opts) end else @tls = ::RubyTls::SSL::Box.new([:server], self, ) end @tls.start self end |