From 69c5b5c4a1aed0df7738af12021c4a6e68535aac Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Wed, 23 May 2012 07:08:17 +0200 Subject: [PATCH] Added configuration section --- distribution-server/dist-daemon | 13 +++++++++++-- node/node-daemon | 10 +++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/distribution-server/dist-daemon b/distribution-server/dist-daemon index d8add9a..31cdc91 100755 --- a/distribution-server/dist-daemon +++ b/distribution-server/dist-daemon @@ -1,5 +1,14 @@ #!/usr/bin/python +################################ +# Configuration starts here + +cert_path = '/home/sven/ssl/cert' +key_path = '/home/sven/ssl/private' + +# Configuration ends here +################################ + import socket, ssl client_list = [] @@ -30,8 +39,8 @@ while True: newsocket, fromaddr = bindsocket.accept() connstream = ssl.wrap_socket(newsocket, server_side=True, - certfile="/home/sven/ssl/cert", - keyfile="/home/sven/ssl/private", + certfile=cert_path, + keyfile=key_path, ssl_version=ssl.PROTOCOL_TLSv1) try: client_list.append(Client(connstream)) diff --git a/node/node-daemon b/node/node-daemon index 3806163..590105c 100644 --- a/node/node-daemon +++ b/node/node-daemon @@ -1,9 +1,17 @@ #!/usr/bin/python +################################ +# Configuration starts here + +allowed_certs = '/home/sven/ssl/allowed' + +# Configuration ends here +################################ + import socket, ssl, pprint s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -ssl_sock = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs='/home/sven/ssl/allowed') +ssl_sock = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs=allowed_certs) ssl_sock.connect(('localhost', 9151)) ssl_sock.write('test data')