|
|
|
@ -94,10 +94,13 @@ def new_key_req(key, cert_path, server_host_name, private_key_passwd = None, \
|
|
|
|
|
return req_file
|
|
|
|
|
|
|
|
|
|
def delete_old_cert(client):
|
|
|
|
|
os.unlink(client.CERT_FILE)
|
|
|
|
|
os.unlink(client.REQ_FILE)
|
|
|
|
|
os.unlink(client.PKEY_FILE)
|
|
|
|
|
os.unlink(client.PubKEY_FILE)
|
|
|
|
|
try:
|
|
|
|
|
os.unlink(client.CERT_FILE)
|
|
|
|
|
os.unlink(client.REQ_FILE)
|
|
|
|
|
os.unlink(client.PKEY_FILE)
|
|
|
|
|
os.unlink(client.PubKEY_FILE)
|
|
|
|
|
except OSError, e:
|
|
|
|
|
print e.message
|
|
|
|
|
|
|
|
|
|
def get_password(text1 = None, text2 = None):
|
|
|
|
|
if not text1:
|
|
|
|
@ -215,7 +218,10 @@ def client_get_cert(cert_path, args):
|
|
|
|
|
fc = open(cert_file, 'w')
|
|
|
|
|
fc.write(cert)
|
|
|
|
|
fc.close()
|
|
|
|
|
os.unlink(cert_path + 'req_id')
|
|
|
|
|
try:
|
|
|
|
|
os.unlink(cert_path + 'req_id')
|
|
|
|
|
except OSError, e:
|
|
|
|
|
print e.message
|
|
|
|
|
print 'OK. Certificate save. Your certificate id = %s' %req_id
|
|
|
|
|
user_name = pwd.getpwuid(os.getuid()).pw_name
|
|
|
|
|
try:
|
|
|
|
@ -352,7 +358,10 @@ def create_socket(file_path, username):
|
|
|
|
|
find_proc = True
|
|
|
|
|
|
|
|
|
|
if not find_proc:
|
|
|
|
|
os.unlink(file_path)
|
|
|
|
|
try:
|
|
|
|
|
os.unlink(file_path)
|
|
|
|
|
except OSError, e:
|
|
|
|
|
print e.message
|
|
|
|
|
|
|
|
|
|
cmd = ['cl-consoled']
|
|
|
|
|
#print cmd
|
|
|
|
|