summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Component.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-04-17 17:35:50 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-04-17 17:35:50 +0000
commit1dcffd08d4a02d3fa202fc6c63c103caac003495 (patch)
treef30acbf9a7879da062dcb5e50da9720794fab88f /src/lib/Server/Component.py
parentdb28a4c3b9cfb636808393deab328881bd652ef9 (diff)
downloadbcfg2-1dcffd08d4a02d3fa202fc6c63c103caac003495.tar.gz
bcfg2-1dcffd08d4a02d3fa202fc6c63c103caac003495.tar.bz2
bcfg2-1dcffd08d4a02d3fa202fc6c63c103caac003495.zip
Add a server-side socket timeout (Reported by pflores)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3049 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Component.py')
-rw-r--r--src/lib/Server/Component.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/Server/Component.py b/src/lib/Server/Component.py
index fe4324b29..95f65a476 100644
--- a/src/lib/Server/Component.py
+++ b/src/lib/Server/Component.py
@@ -7,6 +7,7 @@ import Bcfg2.tlslite.errors
import Bcfg2.tlslite.api
import Bcfg2.Client.Proxy as Proxy
+from Bcfg2.tlslite.TLSConnection import TLSConnection
log = logging.getLogger('Component')
@@ -64,6 +65,13 @@ class TLSServer(Bcfg2.tlslite.api.TLSSocketServerMixIn,
self.chain = Bcfg2.tlslite.api.X509CertChain([x509])
BaseHTTPServer.HTTPServer.__init__(self, address, handler)
+ def finish_request(self, sock, client_address):
+ sock.settimeout(90)
+ tlsConnection = TLSConnection(sock)
+ if self.handshake(tlsConnection) == True:
+ self.RequestHandlerClass(tlsConnection, client_address, self)
+ tlsConnection.close()
+
def handshake(self, tlsConnection):
try:
tlsConnection.handshakeServer(certChain=self.chain,