aboutsummaryrefslogtreecommitdiff
path: root/scripts/http-server.py
blob: a966f6fadc9b715cc75d28f2326156c5f54d3938 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# $Id$

import rpki.https, tlslite.api, rpki.config

cfg = rpki.config.parser("http-demo.conf", "server")

privateKey = rpki.x509.RSA(PEM_file = cfg.get("https-key"))

certChain = rpki.x509.X509_chain()
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)