Sha256: 18d633f0e43243653953b11b3d277504ec55e32eb1a356fdbc0e8d2b359ad121

Contents?: true

Size: 553 Bytes

Versions: 33

Compression:

Stored size: 553 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(:verify_peer => true)
        @stream.start
#        succeed!
      else
        fail! TLSFailure.new
      end
    end

  end #TLS

end #Stream
end #Blather

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
blather-2.0.0 lib/blather/stream/features/tls.rb
blather-1.2.0 lib/blather/stream/features/tls.rb
blather-1.1.4 lib/blather/stream/features/tls.rb
blather-1.1.3 lib/blather/stream/features/tls.rb
blather-1.1.2 lib/blather/stream/features/tls.rb
blather-1.1.1 lib/blather/stream/features/tls.rb
blather-1.1.0 lib/blather/stream/features/tls.rb
blather-1.0.0 lib/blather/stream/features/tls.rb
blather-0.8.8 lib/blather/stream/features/tls.rb
blather-0.8.7 lib/blather/stream/features/tls.rb
blather-0.8.6 lib/blather/stream/features/tls.rb
blather-0.8.5 lib/blather/stream/features/tls.rb
blather-0.8.4 lib/blather/stream/features/tls.rb
blather-0.8.3 lib/blather/stream/features/tls.rb
blather-0.8.2 lib/blather/stream/features/tls.rb
tp-blather-0.8.5 lib/blather/stream/features/tls.rb
tp-blather-0.8.4 lib/blather/stream/features/tls.rb
tp-blather-0.8.3 lib/blather/stream/features/tls.rb
tp-blather-0.8.2 lib/blather/stream/features/tls.rb
blather-0.8.1 lib/blather/stream/features/tls.rb