Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 32 lines (22 sloc) 800 Bytes
import os
import sys
if os.getuid() != 0:
print "E_ROOT: You must be root to use this utility.\n"
print "WARNING: For NameCheap, the 'common name' field must be the domain name you would like to activate."
SSL_DIR = "/etc/ssl/"
def usage():
app_name = sys.argv[0]
print """%s usage:
%s domain_name
domain_name The domain name to generate a key and CSR for
""" % (app_name, app_name)
if len(sys.argv) < 2:
domain_name = sys.argv[1].strip()
os.system("openssl genrsa -out " + SSL_DIR + domain_name + ".key 2048")
os.system("openssl req -new -sha256 -key " + SSL_DIR + domain_name + ".key -out " + SSL_DIR + domain_name + ".csr")
os.system("cat " + SSL_DIR + domain_name + ".csr")
print "\n\nCSR generation complete"
Something went wrong with that request. Please try again.