aboutsummaryrefslogtreecommitdiff
path: root/scripts/http-server.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/http-server.py')
-rw-r--r--scripts/http-server.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/http-server.py b/scripts/http-server.py
index 876ea48c..dd7ec9a2 100644
--- a/scripts/http-server.py
+++ b/scripts/http-server.py
@@ -2,9 +2,15 @@
import rpki.https, tlslite.api, rpki.config
-certInfo = rpki.https.CertInfo(rpki.config.parser("http-demo.conf"), "server")
+cfg = rpki.config.parser("http-demo.conf")
+section = "server"
+
+privateKey = rpki.x509.RSA_Keypair(PEM_file = cfg.get(section, "https-key"))
+
+certChain = rpki.x509.X509_chain()
+certChain.load_from_PEM(cfg.multiget(section, "https-cert"))
def handler(query, path):
return 200, "Path: %s\nQuery: %s" % (path, query)
-rpki.https.server(certInfo=certInfo, handlers={"/" : handler})
+rpki.https.server(privateKey=privateKey, certChain=certChain, handlers={"/" : handler})