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

Method save_chain

test/pyhttpd/certs.py:226–237  ·  view source on GitHub ↗
(self, creds: Credentials, infix: str, with_root=False)

Source from the content-addressed store, hash-verified

224 self._add_credentials(name, creds)
225
226 def save_chain(self, creds: Credentials, infix: str, with_root=False):
227 name = creds.name
228 chain = [creds]
229 while creds.issuer is not None:
230 creds = creds.issuer
231 chain.append(creds)
232 if not with_root and len(chain) > 1:
233 chain = chain[:-1]
234 chain_file = os.path.join(self._store_dir, f'{name}-{infix}.pem')
235 with open(chain_file, "wb") as fd:
236 for c in chain:
237 fd.write(c.cert_pem)
238
239 def _add_credentials(self, name: str, creds: Credentials):
240 if name not in self._creds_by_name:

Callers 1

issue_certMethod · 0.80

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected