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

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: Fixed typos & updated flag description 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..7328bfe2d310b6c58d740bf66bccdacc08ecf0b4 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, disable_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
@@ -201,7 +201,10 @@ class HTTPSServer(tlslite.api.TLSSocketServerMixIn,
self.ssl_handshake_settings.tlsIntolerant = (3, tls_intolerant)
self.ssl_handshake_settings.tlsIntoleranceType = tls_intolerance_type
- if record_resume_info:
+
+ if disable_session_cache:
+ self.session_cache = None
+ elif record_resume_info:
# 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()
@@ -1986,7 +1989,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.disable_session_cache)
print 'HTTPS server started on https://%s:%d...' % \
(host, server.server_port)
else:
@@ -2086,6 +2090,11 @@ class ServerRunner(testserver_base.TestServerRunner):
def add_options(self):
testserver_base.TestServerRunner.add_options(self)
+ self.option_parser.add_option('--disable-session-cache',
+ action='store_true',
+ dest='disable_session_cache',
+ help='tells the server to disable the'
+ 'session cache.')
Ryan Sleevi 2014/08/07 01:08:34 'TLS session cache'
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