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

Method test_md_801_002

test/modules/md/test_801_stapling.py:117–146  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

115 # expect to see stapling response in all cases
116 @pytest.mark.skipif(MDTestEnv.lacks_ocsp(), reason="no OCSP responder")
117 def test_md_801_002(self, env):
118 md = self.mdA
119 self.configure_httpd(env, md, ssl_stapling=True).install()
120 assert env.apache_restart() == 0, f'{env.apachectl_stderr}'
121 stat = env.get_ocsp_status(md)
122 assert stat['ocsp'] == "successful (0x0)" if \
123 env.ssl_module == "mod_ssl" else "no response sent"
124 stat = env.get_md_status(md)
125 assert not stat["stapling"]
126 #
127 # turn stapling on, wait for it to appear in connections
128 self.configure_httpd(env, md, "MDStapling on", ssl_stapling=True).install()
129 assert env.apache_restart() == 0, f'{env.apachectl_stderr}'
130 stat = env.await_ocsp_status(md)
131 assert stat['ocsp'] == "successful (0x0)"
132 assert stat['verify'] == "0 (ok)"
133 stat = env.get_md_status(md)
134 assert stat["stapling"]
135 pkey = 'rsa'
136 assert stat["cert"][pkey]["ocsp"]["status"] == "good"
137 assert stat["cert"][pkey]["ocsp"]["valid"]
138 #
139 # turn stapling off (explicitly) again, should disappear
140 self.configure_httpd(env, md, "MDStapling off", ssl_stapling=True).install()
141 assert env.apache_restart() == 0, f'{env.apachectl_stderr}'
142 stat = env.get_ocsp_status(md)
143 assert stat['ocsp'] == "successful (0x0)" if \
144 env.ssl_module == "mod_ssl" else "no response sent"
145 stat = env.get_md_status(md)
146 assert not stat["stapling"]
147
148 # 2 MDs, one with md stapling on, one with default (off)
149 def test_md_801_003(self, env):

Callers

nothing calls this directly

Calls 6

configure_httpdMethod · 0.95
installMethod · 0.80
apache_restartMethod · 0.80
get_ocsp_statusMethod · 0.80
get_md_statusMethod · 0.80
await_ocsp_statusMethod · 0.80

Tested by

no test coverage detected