From b6745864ea2249dededceb38e891cb6f4686ffd1 Mon Sep 17 00:00:00 2001 From: lxnay Date: Wed, 2 Jul 2008 14:06:14 +0000 Subject: [PATCH] Entropy/SocketHostInterface: - some misc updates git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2230 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/entropy.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/entropy.py b/libraries/entropy.py index e349b75b9..e2b42ee78 100644 --- a/libraries/entropy.py +++ b/libraries/entropy.py @@ -12537,7 +12537,7 @@ class SocketHostInterface: # closed down correctly. allow_reuse_address = True - def __init__(self, server_address, RequestHandlerClass, processor, HostInterface): + def __init__(self, server_address, RequestHandlerClass, processor, HostInterface, authorized_clients_only = False): self.alive = True self.socket = self.socket_mod @@ -12546,6 +12546,7 @@ class SocketHostInterface: self.HostInterface = HostInterface self.SSL = self.HostInterface.SSL self.real_sock = None + self.ssl_authorized_clients_only = authorized_clients_only if self.SSL: self.SocketServer.BaseServer.__init__(self, server_address, RequestHandlerClass) @@ -12562,12 +12563,12 @@ class SocketHostInterface: def load_ssl_context(self): # setup an SSL context. self.context = self.SSL['m'].Context(self.SSL['m'].SSLv23_METHOD) - #self.context.set_verify(self.SSL['m'].VERIFY_PEER, self.verify_ssl_cb) # ask for a certificate - #self.context.set_options(self.SSL['m'].OP_NO_SSLv2) + self.context.set_verify(self.SSL['m'].VERIFY_PEER, self.verify_ssl_cb) # ask for a certificate + self.context.set_options(self.SSL['m'].OP_NO_SSLv2) # load up certificate stuff. self.context.use_privatekey_file(self.SSL['key']) self.context.use_certificate_file(self.SSL['cert']) - #self.context.load_verify_locations(self.SSL['ca_cert']) + self.context.load_verify_locations(self.SSL['ca_cert']) self.HostInterface.updateProgress('SSL context loaded, key: %s - cert: %s, CA cert: %s, CA pkey: %s' % ( self.SSL['key'], self.SSL['cert'],