Commit beea58b1 authored by Akeem Daly's avatar Akeem Daly
Browse files

allow pem suffix for nginx

parent b158cbaa
......@@ -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:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment