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