aboutsummaryrefslogtreecommitdiff
path: root/scripts/http-server.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-12-24 09:31:48 +0000
committerRob Austein <sra@hactrn.net>2007-12-24 09:31:48 +0000
commit4d7072bd10f807558dfd60c2a3e65fe6584bcdb3 (patch)
tree291536b8a8e9c26ff5ac46d988b5587f2d9fc75d /scripts/http-server.py
parent9bd1ce773943b587f83c91c77de7e379df421c63 (diff)
Teach config parser about default sections.
svn path=/scripts/Makefile; revision=1439
Diffstat (limited to 'scripts/http-server.py')
-rw-r--r--scripts/http-server.py9
1 files changed, 4 insertions, 5 deletions
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)