summaryrefslogtreecommitdiffhomepage
path: root/demo_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'demo_server.py')
-rwxr-xr-xdemo_server.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/demo_server.py b/demo_server.py
index 0c7ec518..90ab9bac 100755
--- a/demo_server.py
+++ b/demo_server.py
@@ -12,8 +12,12 @@ if len(l.handlers) == 0:
lh.setFormatter(logging.Formatter('%(levelname)-.3s [%(asctime)s] %(name)s: %(message)s', '%Y%m%d:%H%M%S'))
l.addHandler(lh)
-host_key = paramiko.RSAKey()
-host_key.read_private_key_file('demo_host_key')
+#host_key = paramiko.RSAKey()
+#host_key.read_private_key_file('demo_host_key')
+
+host_key = paramiko.DSSKey()
+host_key.read_private_key_file('demo_dss_key')
+print 'Read key: ' + paramiko.hexify(host_key.get_fingerprint())
class ServerTransport(paramiko.Transport):
@@ -54,12 +58,15 @@ except Exception, e:
try:
sock.listen(100)
+ print 'Listening for connection ...'
client, addr = sock.accept()
except Exception, e:
print '*** Listen/accept failed: ' + str(e)
traceback.print_exc()
sys.exit(1)
+print 'Got a connection!'
+
try:
event = threading.Event()
t = ServerTransport(client)