summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3c9d72)
raw | patch | inline | side by side (parent: f3c9d72)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 14 Oct 2009 10:06:49 +0000 (10:06 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 14 Oct 2009 10:06:49 +0000 (10:06 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4380 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/scripts/roundup_server.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 6c6c2db35d292ffa401ea6d1af178aef27e5e0e3..2ebb1d330b0568845f72df9197765b123e2520e3 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
This also fixes a case where a WantReadError is raised and apparently
the bytes already read are dropped (seems the WantReadError is really
an error, not just an indication to retry).
+- Correct initial- and end-handshakes for SSL
2009-10-09 1.4.10 (r4374)
index 2ebd56ea3c79e3bb26f8b3ea0df00d0bd573eb6a..2e26218fe0b6930312661465dcdd056e776872e7 100644 (file)
except ImportError:
SSL = None
-from time import sleep
-
# python version check
from roundup import configuration, version_check
from roundup import __version__ as roundup_version
def auto_ssl():
print _('WARNING: generating temporary SSL certificate')
- import OpenSSL, time, random, sys
+ import OpenSSL, random
pkey = OpenSSL.crypto.PKey()
pkey.generate_key(OpenSSL.crypto.TYPE_RSA, 768)
cert = OpenSSL.crypto.X509()
try:
return self.__fileobj.readline(*args)
except SSL.WantReadError:
- sleep (.1)
+ time.sleep(.1)
def read(self, *args):
""" SSL.Connection can return WantRead """
try:
return self.__fileobj.read(*args)
except SSL.WantReadError:
- sleep (.1)
+ time.sleep(.1)
def __getattr__(self, attrib):
return getattr(self.__fileobj, attrib)
DEBUG_MODE = self["MULTIPROCESS"] == "debug"
CONFIG = self
+ def setup(self):
+ if self.CONFIG["SSL"]:
+ # perform initial ssl handshake. This will set
+ # internal state correctly so that later closing SSL
+ # socket works (with SSL end-handshake started)
+ self.request.do_handshake()
+ RoundupRequestHandler.setup(self)
+
+ def finish(self):
+ RoundupRequestHandler.finish(self)
+ if self.CONFIG["SSL"]:
+ self.request.shutdown()
+ self.request.close()
+
if self["SSL"]:
base_server = SecureHTTPServer
else: