Sha256: a0ab910f9da5972a16806e0dcb7ef650b4dbc3d019ef2a1c9ab117fd2190ac05

Contents?: true

Size: 531 Bytes

Versions: 4

Compression:

Stored size: 531 Bytes

Contents

module Blather
class Stream

  # @private
  class TLS < Features
    class TLSFailure < BlatherError
      register :tls_failure
    end

    TLS_NS = 'urn:ietf:params:xml:ns:xmpp-tls'.freeze
    register TLS_NS

    def receive_data(stanza)
      case stanza.element_name
      when 'starttls'
        @stream.send "<starttls xmlns='#{TLS_NS}'/>"
      when 'proceed'
        @stream.start_tls
        @stream.start
#        succeed!
      else
        fail! TLSFailure.new
      end
    end

  end #TLS

end #Stream
end #Blather

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blather-0.5.4 lib/blather/stream/features/tls.rb
blather-0.5.3 lib/blather/stream/features/tls.rb
blather-0.5.2 lib/blather/stream/features/tls.rb
blather-0.5.0 lib/blather/stream/features/tls.rb