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

Unified Diff: third_party/tlslite/test/twistedserver.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/tlslite/test/twistedclient.py ('k') | third_party/tlslite/test/verifierDB » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tlslite/test/twistedserver.py
diff --git a/third_party/tlslite/test/twistedserver.py b/third_party/tlslite/test/twistedserver.py
deleted file mode 100644
index 9946e4295c13710e3b09af5f12234ac7855e8d36..0000000000000000000000000000000000000000
--- a/third_party/tlslite/test/twistedserver.py
+++ /dev/null
@@ -1,62 +0,0 @@
-
-from twisted.internet.protocol import Protocol, Factory
-from twisted.internet import reactor
-from twisted.protocols.policies import WrappingFactory
-from twisted.protocols.basic import LineReceiver
-from twisted.python import log
-from twisted.python.failure import Failure
-import sys
-from tlslite.api import *
-
-s = open("./serverX509Cert.pem").read()
-x509 = X509()
-x509.parse(s)
-certChain = X509CertChain([x509])
-
-s = open("./serverX509Key.pem").read()
-privateKey = parsePEMKey(s, private=True)
-
-verifierDB = VerifierDB("verifierDB")
-verifierDB.open()
-
-class Echo(LineReceiver):
- def connectionMade(self):
- self.transport.write("Welcome to the echo server!\r\n")
-
- def lineReceived(self, line):
- self.transport.write(line + "\r\n")
-
-class Echo1(Echo):
- def connectionMade(self):
- if not self.transport.tlsStarted:
- self.transport.setServerHandshakeOp(certChain=certChain,
- privateKey=privateKey,
- verifierDB=verifierDB)
- else:
- Echo.connectionMade(self)
-
- def connectionLost(self, reason):
- pass #Handle any TLS exceptions here
-
-class Echo2(Echo):
- def lineReceived(self, data):
- if data == "STARTTLS":
- self.transport.setServerHandshakeOp(certChain=certChain,
- privateKey=privateKey,
- verifierDB=verifierDB)
- else:
- Echo.lineReceived(self, data)
-
- def connectionLost(self, reason):
- pass #Handle any TLS exceptions here
-
-factory = Factory()
-factory.protocol = Echo1
-#factory.protocol = Echo2
-
-wrappingFactory = WrappingFactory(factory)
-wrappingFactory.protocol = TLSTwistedProtocolWrapper
-
-log.startLogging(sys.stdout)
-reactor.listenTCP(1079, wrappingFactory)
-reactor.run()
« no previous file with comments | « third_party/tlslite/test/twistedclient.py ('k') | third_party/tlslite/test/verifierDB » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698