Class: Vines::Stream::Client::TLS
- Defined in:
- lib/vines/stream/client/tls.rb
Direct Known Subclasses
Constant Summary collapse
- NS =
NAMESPACES[:tls]
- PROCEED =
%Q{<proceed xmlns="#{NS}"/>}.freeze
- FAILURE =
%Q{<failure xmlns="#{NS}"/>}.freeze
- STARTTLS =
'starttls'.freeze
Constants inherited from State
Instance Attribute Summary
Attributes inherited from State
Instance Method Summary collapse
-
#initialize(stream, success = AuthRestart) ⇒ TLS
constructor
A new instance of TLS.
- #node(node) ⇒ Object
Methods inherited from State
Methods included from Log
Constructor Details
#initialize(stream, success = AuthRestart) ⇒ TLS
Returns a new instance of TLS.
12 13 14 |
# File 'lib/vines/stream/client/tls.rb', line 12 def initialize(stream, success=AuthRestart) super end |
Instance Method Details
#node(node) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# 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 |