MCPcopy Create free account
hub / github.com/apache/httpd / MDConf

Class MDConf

test/modules/md/md_conf.py:5–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4
5class MDConf(HttpdConf):
6
7 def __init__(self, env: MDTestEnv, text=None, std_ports=True,
8 local_ca=True, std_vhosts=True, proxy=False,
9 admin=None):
10 super().__init__(env=env)
11
12 if admin is None:
13 admin = f"admin@{env.http_tld}"
14 if len(admin.strip()):
15 self.add_admin(admin)
16 self.add([
17 "MDRetryDelay 1s", # speed up testing a little
18 "MDRenewViaARI off", # not on, logs unwanted errors when test
19 # acme server is not responding
20 ])
21 if local_ca:
22 self.add([
23 f"MDCertificateAuthority {env.acme_url}",
24 f"MDCertificateAgreement accepted",
25 f"MDCACertificateFile {env.server_dir}/acme-ca.pem",
26 "",
27 ])
28 if std_ports:
29 self.add(f"MDPortMap 80:{env.http_port} 443:{env.https_port}")
30 if env.ssl_module == "mod_tls":
31 self.add(f"TLSListen {env.https_port}")
32 self.add([
33 "<Location /server-status>",
34 " SetHandler server-status",
35 "</Location>",
36 "<Location /md-status>",
37 " SetHandler md-status",
38 "</Location>",
39 ])
40 if std_vhosts:
41 self.add_vhost_test1()
42 if proxy:
43 self.add([
44 f"Listen {self.env.proxy_port}",
45 f"<VirtualHost *:{self.env.proxy_port}>",
46 " ProxyRequests On",
47 " ProxyVia On",
48 " # be totally open",
49 " AllowCONNECT 0-56535",
50 " <Proxy *>",
51 " # No require or other restrictions, this is just a test server",
52 " </Proxy>",
53 "</VirtualHost>",
54 ])
55 if text is not None:
56 self.add(text)
57
58 def add_drive_mode(self, mode):
59 self.add("MDRenewMode \"%s\"\n" % mode)
60
61 def add_renew_window(self, window):
62 self.add("MDRenewWindow %s\n" % window)

Callers 15

_class_scopeMethod · 0.85
test_md_790_001Method · 0.85
test_md_790_002Method · 0.85
test_md_790_003Method · 0.85
_class_scopeMethod · 0.85
test_md_710_001Method · 0.85
test_md_710_002Method · 0.85
test_md_710_003Method · 0.85
test_md_710_004Method · 0.85
test_md_300_001Method · 0.85
test_md_300_002Method · 0.85
test_md_300_003Method · 0.85

Calls

no outgoing calls

Tested by 15

_class_scopeMethod · 0.68
test_md_790_001Method · 0.68
test_md_790_002Method · 0.68
test_md_790_003Method · 0.68
_class_scopeMethod · 0.68
test_md_710_001Method · 0.68
test_md_710_002Method · 0.68
test_md_710_003Method · 0.68
test_md_710_004Method · 0.68
test_md_300_001Method · 0.68
test_md_300_002Method · 0.68
test_md_300_003Method · 0.68