Index: net/tools/testserver/testserver.py |
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py |
index 60b7b2817f47c5f238e9b55c23eff4604d096c2b..9babbb24eb43bc51c234a510a0cfdad93bdda8c0 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' |
+ 'TLS session cache.') |
self.option_parser.add_option('-f', '--ftp', action='store_const', |
const=SERVER_FTP, default=SERVER_HTTP, |
dest='server_type', |