Skip to content

Commit

Permalink
add fullkey extraction, for haproxy, ejabberd and so on
Browse files Browse the repository at this point in the history
  • Loading branch information
raph2i committed Mar 22, 2020
1 parent 412e5da commit 28a784f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def createCerts(args):
f.write(fullchain)
with (directory / name + '.chain.pem').open('w') as f:
f.write(chain)
with (directory / name + '.fullkey.pem').open('w') as f:
f.write(fullchain + '\n' + privatekey)


if sans:
for name in sans:
Expand All @@ -145,6 +148,9 @@ def createCerts(args):
f.write(fullchain)
with (directory / name + '.chain.pem').open('w') as f:
f.write(chain)
with (directory / name + '.fullkey.pem').open('w') as f:
f.write(fullchain + '\n' + privatekey)

else:
directory = directory / name
if not directory.exists():
Expand All @@ -163,6 +169,9 @@ def createCerts(args):
with (directory / 'fullchain.pem').open('w') as f:
f.write(fullchain)

with (directory / 'fullkey.pem').open('w') as f:
f.write(fullchain + '\n' + privatekey)

print('Extracted certificate for: ' + name +
(', ' + ', '.join(sans) if sans else ''))
names.append(name)
Expand Down

0 comments on commit 28a784f

Please sign in to comment.