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

import rpki.config, rpki.https

msg = "This is a test.  This is only a test.  Had this been real you would now be really confused.\n"

cfg = rpki.config.parser("http-demo.conf")
section = "client"

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"))

x509TrustList = rpki.x509.X509_chain()
x509TrustList.load_from_PEM(cfg.multiget(section, "https-ta"))

print rpki.https.client(privateKey=privateKey, certChain=certChain, x509TrustList=x509TrustList, msg=msg)