class Vines::Stream::Client::TLS
Constants
- FAILURE
- NS
- PROCEED
- STARTTLS
Public Class Methods
new(stream, success=AuthRestart)
click to toggle source
Calls superclass method
# File lib/vines/stream/client/tls.rb, line 12 def initialize(stream, success=AuthRestart) super end
Public Instance Methods
node(node)
click to toggle source
# File lib/vines/stream/client/tls.rb, line 16 def node(node) raise StreamErrors::NotAuthorized unless starttls?(node) if stream.encrypt? stream.write(PROCEED) stream.encrypt stream.reset advance else stream.write(FAILURE) stream.write('</stream:stream>') stream.close_connection_after_writing end end
Private Instance Methods
starttls?(node)
click to toggle source
# File lib/vines/stream/client/tls.rb, line 32 def starttls?(node) node.name == STARTTLS && namespace(node) == NS end