From 4d7072bd10f807558dfd60c2a3e65fe6584bcdb3 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 24 Dec 2007 09:31:48 +0000 Subject: Teach config parser about default sections. svn path=/scripts/Makefile; revision=1439 --- scripts/http-server.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'scripts/http-server.py') diff --git a/scripts/http-server.py b/scripts/http-server.py index 7716d5ed..a966f6fa 100644 --- a/scripts/http-server.py +++ b/scripts/http-server.py @@ -2,15 +2,14 @@ import rpki.https, tlslite.api, rpki.config -cfg = rpki.config.parser("http-demo.conf") -section = "server" +cfg = rpki.config.parser("http-demo.conf", "server") -privateKey = rpki.x509.RSA(PEM_file = cfg.get(section, "https-key")) +privateKey = rpki.x509.RSA(PEM_file = cfg.get("https-key")) certChain = rpki.x509.X509_chain() -certChain.load_from_PEM(cfg.multiget(section, "https-cert")) +certChain.load_from_PEM(cfg.multiget("https-cert")) def handler(query, path): return 200, "Path: %s\nQuery: %s" % (path, query) -rpki.https.server(privateKey=privateKey, certChain=certChain, handlers=handler) +rpki.https.server(privateKey = privateKey, certChain = certChain, handlers = handler) -- cgit v1.2.3