Sha256: cbfb65f7a70d61253d41f0a638d4c675e1855acca4857b1b19a0db122bc4fc1f
Contents?: true
Size: 625 Bytes
Versions: 66
Compression:
Stored size: 625 Bytes
Contents
require 'gssapi' require 'base64' require 'socket' host = 'example.org' service = 'host' sock = TCPSocket.new(host, 8082) cli = GSSAPI::Simple.new(host, service) tok = cli.init_context stok = Base64.strict_encode64(tok) sock.write("#{stok}\n") # send initial token stok = sock.gets.chomp # get back continuation token ctx = cli.init_context(Base64.strict_decode64(stok.chomp)) # complete security context puts "Connection #{(ctx ? 'succeeded' : 'failed')}" begin print "> " msg = STDIN.gets.chomp emsg = cli.wrap_message(msg) sock.write("#{Base64.strict_encode64(emsg)}\n") end while msg != 'exit' sock.close
Version data entries
66 entries across 57 versions & 6 rubygems