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

Unified Diff: net/tools/testserver/testserver.py

Issue 416683002: This CL corrects a bug in which the OnHandshakeComplete callback for an ssl session was never called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@r2
Patch Set: Added SessionIsGood method to replace completion count when checking if a session is finished. Created 6 years, 4 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
Index: net/tools/testserver/testserver.py
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index 60b7b2817f47c5f238e9b55c23eff4604d096c2b..019e782a806df2466afc2663830e8e2912ecdf7d 100755
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -157,7 +157,7 @@ class HTTPSServer(tlslite.api.TLSSocketServerMixIn,
ssl_bulk_ciphers, ssl_key_exchanges, enable_npn,
record_resume_info, tls_intolerant,
tls_intolerance_type, signed_cert_timestamps,
- fallback_scsv_enabled, ocsp_response):
+ fallback_scsv_enabled, ocsp_response, none_session_cache):
self.cert_chain = tlslite.api.X509CertChain()
self.cert_chain.parsePemList(pem_cert_and_key)
# Force using only python implementation - otherwise behavior is different
@@ -205,6 +205,8 @@ class HTTPSServer(tlslite.api.TLSSocketServerMixIn,
# If record_resume_info is true then we'll replace the session cache with
# an object that records the lookups and inserts that it sees.
self.session_cache = RecordingSSLSessionCache()
+ elif none_session_cache:
+ self.session_cache = None
Ryan Sleevi 2014/08/06 23:42:04 This doesn't seem to reflect your documentation S
mshelley 2014/08/07 00:21:59 Done.
else:
self.session_cache = tlslite.api.SessionCache()
testserver_base.StoppableHTTPServer.__init__(self,
@@ -1986,7 +1988,8 @@ class ServerRunner(testserver_base.TestServerRunner):
self.options.signed_cert_timestamps_tls_ext.decode(
"base64"),
self.options.fallback_scsv,
- stapled_ocsp_response)
+ stapled_ocsp_response,
+ self.options.none_session_cache)
print 'HTTPS server started on https://%s:%d...' % \
(host, server.server_port)
else:
@@ -2086,6 +2089,10 @@ class ServerRunner(testserver_base.TestServerRunner):
def add_options(self):
testserver_base.TestServerRunner.add_options(self)
+ self.option_parser.add_option('--none-session-cache', action='store_true',
+ dest='none_session_cache',
+ help='tells the server to use a None'
+ 'session cache.')
Ryan Sleevi 2014/08/06 23:42:04 need to update these command-line flags too, to ma
mshelley 2014/08/07 00:21:59 Done.
self.option_parser.add_option('-f', '--ftp', action='store_const',
const=SERVER_FTP, default=SERVER_HTTP,
dest='server_type',
« net/socket/ssl_session_cache_openssl.cc ('K') | « net/test/spawned_test_server/base_test_server.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698