Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anesthesia IT
tools
security
Commits
beea58b1
Commit
beea58b1
authored
Nov 07, 2022
by
Akeem Daly
Browse files
allow pem suffix for nginx
parent
b158cbaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
cert_util.py
View file @
beea58b1
...
...
@@ -91,6 +91,7 @@ if __name__ == '__main__':
parser
.
add_argument
(
'--domainname'
,
dest
=
'domain_name'
,
action
=
'store'
,
required
=
True
,
help
=
'Fully Qualified Domain Name Needed'
)
parser
.
add_argument
(
'--certpath'
,
dest
=
'cert_path'
,
action
=
'store'
,
default
=
'/etc/ssl/certs'
,
help
=
'Path to Certificates'
)
parser
.
add_argument
(
'--keypath'
,
dest
=
'key_path'
,
action
=
'store'
,
default
=
'/etc/ssl/private'
,
help
=
'Path to Private Keys'
)
parser
.
add_argument
(
'--suffix'
,
dest
=
'suffix_type'
,
action
=
'store'
,
choices
=
[
'legacy'
,
'pem'
],
default
=
'legacy'
,
help
=
'Suffix to use for Private Key'
)
uploadTypeGroup
=
parser
.
add_mutually_exclusive_group
(
required
=
True
)
uploadTypeGroup
.
add_argument
(
'--newcsr'
,
dest
=
'new_csr'
,
action
=
'store_true'
,
help
=
'New Signing Request'
)
uploadTypeGroup
.
add_argument
(
'--self-signed-cert'
,
dest
=
'self_signed_cert'
,
action
=
'store_true'
,
help
=
'New Self Signing Cert'
)
...
...
@@ -108,10 +109,13 @@ except Exception:
formatted_hostname
=
args
.
domain_name
.
replace
(
"."
,
"_"
)
if
args
.
new_csr
==
True
:
csr_file
=
args
.
cert_path
+
"/"
+
formatted_hostname
+
".csr"
key_file
=
args
.
key_path
+
"/"
+
formatted_hostname
+
".key"
cert_file
=
args
.
cert_path
+
"/"
+
formatted_hostname
+
".cer"
if
args
.
suffix_type
==
"legacy"
:
key_file
=
args
.
key_path
+
"/"
+
formatted_hostname
+
".key"
elif
args
.
suffix_type
==
"pem"
:
key_file
=
args
.
key_path
+
"/"
+
formatted_hostname
+
"_key.pem"
url
=
"https://"
+
args
.
domain_name
signing_req
(
key_file
,
csr_file
,
args
.
domain_name
)
if
args
.
self_signed_cert
==
True
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment