diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/loginfo.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/loginfo.py b/tools/loginfo.py index c61ad1b..ff55de9 100755 --- a/tools/loginfo.py +++ b/tools/loginfo.py @@ -21,16 +21,22 @@ def main(): help="Print tree size") parser.add_argument('--signature', action='store_true', help="Print signature") - parser.add_argument('--config', help="System configuration", required=True) - parser.add_argument('--localconfig', help="Local configuration", - required=True) + parser.add_argument('--config', help="System configuration") + parser.add_argument('--localconfig', help="Local configuration") parser.add_argument('baseurl', help="Log base URL") args = parser.parse_args() - #config = yaml.load(open(args.config)) - localconfig = yaml.load(open(args.localconfig)) - paths = localconfig["paths"] - create_ssl_context(cafile=paths["https_cacertfile"]) + paths = None + if (args.localconfig): + localconfig = yaml.load(open(args.localconfig)) + paths = localconfig["paths"] + + if ('https://' in args.baseurl): + if paths is None: + print >>stderr, "need --localconfig for CA cert" + return -1 + create_ssl_context(cafile=paths["https_cacertfile"]) + sth = get_sth(args.baseurl) if args.raw: |