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

Method get_ocsp_status

test/modules/md/md_env.py:571–601  ·  view source on GitHub ↗
(self, domain, proto=None, cipher=None, ca_file=None)

Source from the content-addressed store, hash-verified

569 self.check_file_access(self.store_stagings(), 0o755)
570
571 def get_ocsp_status(self, domain, proto=None, cipher=None, ca_file=None):
572 stat = {}
573 args = [
574 "openssl", "s_client", "-status",
575 "-connect", "%s:%s" % (self._httpd_addr, self.https_port),
576 "-CAfile", ca_file if ca_file else self.acme_ca_pemfile,
577 "-servername", domain,
578 "-showcerts"
579 ]
580 if proto is not None:
581 args.extend(["-{0}".format(proto)])
582 if cipher is not None:
583 args.extend(["-cipher", cipher])
584 r = self.run(args, debug_log=False)
585 ocsp_regex = re.compile(r'OCSP response: +([^=\n]+)\n')
586 matches = ocsp_regex.finditer(r.stdout)
587 for m in matches:
588 if m.group(1) != "":
589 stat['ocsp'] = m.group(1)
590 if 'ocsp' not in stat:
591 ocsp_regex = re.compile(r'OCSP Response Status:\s*(.+)')
592 matches = ocsp_regex.finditer(r.stdout)
593 for m in matches:
594 if m.group(1) != "":
595 stat['ocsp'] = m.group(1)
596 verify_regex = re.compile(r'Verify return code:\s*(.+)')
597 matches = verify_regex.finditer(r.stdout)
598 for m in matches:
599 if m.group(1) != "":
600 stat['verify'] = m.group(1)
601 return stat
602
603 def await_ocsp_status(self, domain, timeout=10, ca_file=None):
604 try_until = time.time() + timeout

Callers 8

await_ocsp_statusMethod · 0.95
test_md_801_001Method · 0.80
test_md_801_002Method · 0.80
test_md_801_003Method · 0.80
test_md_801_004Method · 0.80
test_md_801_009Method · 0.80
test_md_800_002Method · 0.80
test_md_800_004Method · 0.80

Calls 1

runMethod · 0.45

Tested by 7

test_md_801_001Method · 0.64
test_md_801_002Method · 0.64
test_md_801_003Method · 0.64
test_md_801_004Method · 0.64
test_md_801_009Method · 0.64
test_md_800_002Method · 0.64
test_md_800_004Method · 0.64