|
|
@ -92,6 +92,9 @@ def connect_with_cert(cert, path_to_cert, url, args, wait_thread, clVarsCore,
|
|
|
|
cert_name = cert
|
|
|
|
cert_name = cert
|
|
|
|
CERT_FILE = os.path.join(path_to_cert, cert_name + '.crt')
|
|
|
|
CERT_FILE = os.path.join(path_to_cert, cert_name + '.crt')
|
|
|
|
CERT_KEY = os.path.join(path_to_cert, cert_name + '.key')
|
|
|
|
CERT_KEY = os.path.join(path_to_cert, cert_name + '.key')
|
|
|
|
|
|
|
|
if not os.path.isfile(CERT_FILE) or not os.path.isfile(CERT_KEY):
|
|
|
|
|
|
|
|
Connect_Error = 1
|
|
|
|
|
|
|
|
return (None, 1, crypto_Error, False, None)
|
|
|
|
client = None
|
|
|
|
client = None
|
|
|
|
|
|
|
|
|
|
|
|
bio = M2Crypto.BIO.openfile(CERT_KEY)
|
|
|
|
bio = M2Crypto.BIO.openfile(CERT_KEY)
|
|
|
@ -104,9 +107,10 @@ def connect_with_cert(cert, path_to_cert, url, args, wait_thread, clVarsCore,
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
key_passwd = None
|
|
|
|
key_passwd = None
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
|
|
|
|
ca_certs = os.path.join(path_to_cert, 'ca/ca_root.crt')
|
|
|
|
client = Client_suds(url, transport=HTTPSClientCertTransport \
|
|
|
|
client = Client_suds(url, transport=HTTPSClientCertTransport \
|
|
|
|
(CERT_KEY, CERT_FILE, path_to_cert, password=key_passwd,
|
|
|
|
(CERT_KEY, CERT_FILE, path_to_cert, password=key_passwd,
|
|
|
|
wait_thread = wait_thread))
|
|
|
|
ca_certs = ca_certs, wait_thread = wait_thread))
|
|
|
|
if not wait_thread.isAlive():
|
|
|
|
if not wait_thread.isAlive():
|
|
|
|
wait_thread = StoppableThread()
|
|
|
|
wait_thread = StoppableThread()
|
|
|
|
flag_thread_start = True
|
|
|
|
flag_thread_start = True
|
|
|
@ -154,7 +158,7 @@ def add_server_hostname(host, path_to_cert, server_hostname):
|
|
|
|
temp_file = ''
|
|
|
|
temp_file = ''
|
|
|
|
find_flag = False
|
|
|
|
find_flag = False
|
|
|
|
for line in readLinesFile(compliance_file):
|
|
|
|
for line in readLinesFile(compliance_file):
|
|
|
|
adress, server_hostname = line.split(' ',1)
|
|
|
|
adress, temp_server_hostname = line.split(' ',1)
|
|
|
|
if adress == host:
|
|
|
|
if adress == host:
|
|
|
|
temp_file += "%s %s\n" %(adress, server_hostname)
|
|
|
|
temp_file += "%s %s\n" %(adress, server_hostname)
|
|
|
|
find_flag = True
|
|
|
|
find_flag = True
|
|
|
@ -371,9 +375,9 @@ def main(wait_thread):
|
|
|
|
print _('Password is invalid')
|
|
|
|
print _('Password is invalid')
|
|
|
|
# delete password from daemon list
|
|
|
|
# delete password from daemon list
|
|
|
|
clear_password(host, port)
|
|
|
|
clear_password(host, port)
|
|
|
|
get_name_flag = False
|
|
|
|
|
|
|
|
if e:
|
|
|
|
if e:
|
|
|
|
wait_thread.stop()
|
|
|
|
wait_thread.stop()
|
|
|
|
|
|
|
|
if type(e.message) != int:
|
|
|
|
print _('Error: '), e
|
|
|
|
print _('Error: '), e
|
|
|
|
get_name_flag = False
|
|
|
|
get_name_flag = False
|
|
|
|
|
|
|
|
|
|
|
@ -432,6 +436,7 @@ def main(wait_thread):
|
|
|
|
Connect_Error = 1
|
|
|
|
Connect_Error = 1
|
|
|
|
crypto_Error = 0
|
|
|
|
crypto_Error = 0
|
|
|
|
e = None
|
|
|
|
e = None
|
|
|
|
|
|
|
|
|
|
|
|
for i in range (0, len(fit_cert_list)):
|
|
|
|
for i in range (0, len(fit_cert_list)):
|
|
|
|
cert_name = fit_cert_list.pop()
|
|
|
|
cert_name = fit_cert_list.pop()
|
|
|
|
client, Connect_Error, crypto_Error, passwd_flag, e = \
|
|
|
|
client, Connect_Error, crypto_Error, passwd_flag, e = \
|
|
|
@ -454,6 +459,7 @@ def main(wait_thread):
|
|
|
|
return 1
|
|
|
|
return 1
|
|
|
|
if e:
|
|
|
|
if e:
|
|
|
|
wait_thread.stop()
|
|
|
|
wait_thread.stop()
|
|
|
|
|
|
|
|
if type(e.message) != int:
|
|
|
|
print _('Error: '), e
|
|
|
|
print _('Error: '), e
|
|
|
|
return 1
|
|
|
|
return 1
|
|
|
|
|
|
|
|
|
|
|
|