ANN: Snakelets 1.38 (simple-to-use web app server with dynamic pages)
Roland Heiber
newstonne at web.de
Wed Mar 23 10:26:23 EST 2005
Irmen de Jong wrote:
> I'm happy to say that Snakelets 1.38 is available.
Fine thing again! Maybe someone is interested in this:
I just tried tlslite and did a dirty hack so you could use snakelets via
SSL. See the patch below. Snip and save it, use it against
snakeserver/server.py.
You've to place a key-pair in your server-dir
(localhost.crt/localhost.private.key in the path). You can generate a
self-signed certificate easily with openssl.
HtH, Roland
----- SNIP AND SAVE BELOW -----
961d
927a
def handshake(self, tlsConnection):
try:
tlsConnection.handshakeServer(certChain=certChain,
privateKey=privateKey,
sessionCache=sessionCache)
tlsConnection.ignoreAbruptClose = True
return True
except (SyntaxError, TLSError), error:
print "Handshake failure:", str(error)
return False
.
908c
if IS_SSL:
tlsConnection = TLSConnection(request)
if self.handshake(tlsConnection) == True:
self.RequestHandlerClass(tlsConnection,
client_address, self)
tlsConnection.close()
else:
self.RequestHandlerClass(request, client_address, self)
.
889c
if IS_SSL:
tlsConnection = TLSConnection(request)
if self.handshake(tlsConnection) == True:
self.RequestHandlerClass(tlsConnection,
client_address, self)
tlsConnection.close()
else:
self.RequestHandlerClass(request, client_address, self)
.
21a
IS_SSL=True
try:
from tlslite.api import *
except ImportError:
IS_SSL=False
if IS_SSL:
s = open("./localhost.crt").read()
x509 = X509()
x509.parse(s)
certChain = X509CertChain([x509])
s = open("./localhost.private.key").read()
privateKey = parsePEMKey(s, private=True)
sessionCache = SessionCache()
.
More information about the Python-list
mailing list