diff options
Diffstat (limited to 'tools/submitcert.py')
-rwxr-xr-x | tools/submitcert.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/submitcert.py b/tools/submitcert.py index 9f0be67..1c79544 100755 --- a/tools/submitcert.py +++ b/tools/submitcert.py @@ -44,10 +44,16 @@ sth = get_sth(baseurl) def submitcert((certfile, cert)): timing = timing_point() certchain = get_certs_from_string(cert) + precerts = get_precerts_from_string(cert) + assert len(precerts) == 0 or len(precerts) == 1 + precert = precerts[0] if precerts else None timing_point(timing, "readcerts") try: - result = add_chain(baseurl, {"chain":map(base64.b64encode, certchain)}) + if precert: + result = add_prechain(baseurl, {"chain":map(base64.b64encode, [precert] + certchain)}) + else: + result = add_chain(baseurl, {"chain":map(base64.b64encode, certchain)}) except SystemExit: print "EXIT:", certfile select.select([], [], [], 1.0) |