Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: third_party/tlslite/test/httpsserver.py

Issue 210323002: Update tlslite to 0.4.6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Executable bit and --similarity=80 Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/tlslite/test/clientX509Key.pem ('k') | third_party/tlslite/test/index.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 from SocketServer import *
2 from BaseHTTPServer import *
3 from SimpleHTTPServer import *
4 from tlslite.api import *
5
6 s = open("./serverX509Cert.pem").read()
7 x509 = X509()
8 x509.parse(s)
9 certChain = X509CertChain([x509])
10
11 s = open("./serverX509Key.pem").read()
12 privateKey = parsePEMKey(s, private=True)
13
14 sessionCache = SessionCache()
15
16 class MyHTTPServer(ThreadingMixIn, TLSSocketServerMixIn, HTTPServer):
17 def handshake(self, tlsConnection):
18 try:
19 tlsConnection.handshakeServer(certChain=certChain,
20 privateKey=privateKey,
21 sessionCache=sessionCache)
22 tlsConnection.ignoreAbruptClose = True
23 return True
24 except TLSError, error:
25 print "Handshake failure:", str(error)
26 return False
27
28 httpd = MyHTTPServer(('localhost', 443), SimpleHTTPRequestHandler)
29 httpd.serve_forever()
OLDNEW
« no previous file with comments | « third_party/tlslite/test/clientX509Key.pem ('k') | third_party/tlslite/test/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698