aboutsummaryrefslogtreecommitdiff
path: root/openssl/vendor/0.9.8b/doc/crypto/BIO_ctrl.pod
blob: 722e8b8f46c9c5b202bb4283338e7411d582f2d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
generated by cgit v1.2.3 (git 2.25.1) at 2025-06-26 22:02:21 +0000
 


> 400, "Could not process PDU: %s" % data

def cronjob_handler(query, path):
  for s in rpki.left_right.self_elt.sql_fetch_all(gctx):
    s.client_poll(gctx)
  #raise rpki.exceptions.NotImplementedYet

class global_context(object):
  """A container for various global parameters."""

  def __init__(self, cfg, section):

    self.db = MySQLdb.connect(user   = cfg.get(section, "sql-username"),
                              db     = cfg.get(section, "sql-database"),
                              passwd = cfg.get(section, "sql-password"))
    self.cur = self.db.cursor()

    self.cms_ta_irdb = rpki.x509.X509(Auto_file = cfg.get(section, "cms-ta-irdb"))
    self.cms_ta_irbe = rpki.x509.X509(Auto_file = cfg.get(section, "cms-ta-irbe"))
    self.cms_key     = rpki.x509.RSA(Auto_file = cfg.get(section, "cms-key"))
    self.cms_certs   = rpki.x509.X509_chain(Auto_files = cfg.multiget(section, "cms-cert"))

    self.https_key   = rpki.x509.RSA(Auto_file = cfg.get(section, "https-key"))
    self.https_certs = rpki.x509.X509_chain(Auto_files = cfg.multiget(section, "https-cert"))
    self.https_tas   = rpki.x509.X509_chain(Auto_files = cfg.multiget(section, "https-ta"))

    self.irdb_url    = cfg.get(section, "irdb-url")

    self.https_server_host = cfg.get(section, "server-host", "")
    self.https_server_port = int(cfg.get(section, "server-port", "4433"))

os.environ["TZ"] = "UTC"
time.tzset()

cfg_file = "rpkid.conf"

opts,argv = getopt.getopt(sys.argv[1:], "c:h?", ["config=", "help"])
for o,a in opts:
  if o in ("-h", "--help", "-?"):
    print __doc__
    sys.exit(0)
  if o in ("-c", "--config"):
    cfg_file = a
if argv:
  raise RuntimeError, "Unexpected arguments %s" % argv

gctx = global_context(cfg = rpki.config.parser(cfg_file), section = "rpkid")

rpki.https.server(privateKey = gctx.https_key,
                  certChain = gctx.https_certs,
                  host = gctx.https_server_host,
                  port = gctx.https_server_port,
                  handlers=(("/left-right", left_right_handler),
                            ("/up-down/",   up_down_handler),
                            ("/cronjob",    cronjob_handler)))