Index: net/tools/testserver/testserver.py |
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py |
index ba130af9943364d9941f55cba3746f2175a799dc..3aee17a6b28d40190aec47ae184804f1bb2acb97 100755 |
--- a/net/tools/testserver/testserver.py |
+++ b/net/tools/testserver/testserver.py |
@@ -1912,11 +1912,25 @@ class ServerRunner(testserver_base.TestServerRunner): |
raise testserver_base.OptionError('unknown OCSP status: ' + |
self.options.ocsp_status) |
+ ocsp_date = None |
+ if self.options.ocsp_date == 'valid': |
+ ocsp_date = minica.OCSP_DATE_VALID |
+ elif self.options.ocsp_date == 'old': |
+ ocsp_date = minica.OCSP_DATE_OLD |
+ elif self.options.ocsp_date == 'young': |
+ ocsp_date = minica.OCSP_DATE_YOUNG |
+ elif self.options.ocsp_date == 'long': |
+ ocsp_date = minica.OCSP_DATE_LONG |
+ else: |
+ raise testserver_base.OptionError('unknown OCSP date: ' + |
+ self.options.ocsp_date) |
+ |
(pem_cert_and_key, ocsp_der) = minica.GenerateCertKeyAndOCSP( |
subject = "127.0.0.1", |
ocsp_url = ("http://%s:%d/ocsp" % |
(host, self.__ocsp_server.server_port)), |
ocsp_state = ocsp_state, |
+ ocsp_date = ocsp_date, |
serial = self.options.cert_serial) |
if self.options.ocsp_server_unavailable: |
@@ -2088,6 +2102,9 @@ class ServerRunner(testserver_base.TestServerRunner): |
help='The type of OCSP response generated ' |
'for the automatically generated ' |
'certificate. One of [ok,revoked,invalid]') |
+ self.option_parser.add_option('--ocsp-date', dest='ocsp_date', |
+ default='valid', help= 'The validity of the ' |
+ 'range between thisUpdate and nextUpdate') |
self.option_parser.add_option('--cert-serial', dest='cert_serial', |
default=0, type=int, |
help='If non-zero then the generated ' |