|
|
@ -204,9 +204,6 @@ def connect_with_cert(cert, path_to_cert, url, args, wait_thread, clVarsCore,
|
|
|
|
if not rsa:
|
|
|
|
if not rsa:
|
|
|
|
store_passwd = get_password_from_daemon(args.host, args.port,
|
|
|
|
store_passwd = get_password_from_daemon(args.host, args.port,
|
|
|
|
wait_thread)
|
|
|
|
wait_thread)
|
|
|
|
if not wait_thread.isAlive():
|
|
|
|
|
|
|
|
wait_thread = StoppableThread()
|
|
|
|
|
|
|
|
wait_thread.start()
|
|
|
|
|
|
|
|
if 'store_passwd' in locals():
|
|
|
|
if 'store_passwd' in locals():
|
|
|
|
key_passwd = store_passwd
|
|
|
|
key_passwd = store_passwd
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -215,9 +212,6 @@ def connect_with_cert(cert, path_to_cert, url, args, wait_thread, clVarsCore,
|
|
|
|
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))
|
|
|
|
wait_thread = wait_thread))
|
|
|
|
if not wait_thread.isAlive():
|
|
|
|
|
|
|
|
wait_thread = StoppableThread()
|
|
|
|
|
|
|
|
wait_thread.start()
|
|
|
|
|
|
|
|
client.wsdl.services[0].setlocation(url)
|
|
|
|
client.wsdl.services[0].setlocation(url)
|
|
|
|
client.set_parameters (path_to_cert, CERT_FILE, CERT_KEY)
|
|
|
|
client.set_parameters (path_to_cert, CERT_FILE, CERT_KEY)
|
|
|
|
client_post_cert(client, clVarsCore)
|
|
|
|
client_post_cert(client, clVarsCore)
|
|
|
@ -352,6 +346,9 @@ def main():
|
|
|
|
client, Connect_Error, crypto_Error, passwd_flag, e = \
|
|
|
|
client, Connect_Error, crypto_Error, passwd_flag, e = \
|
|
|
|
connect_with_cert (serv_hostname, path_to_cert, url, args,
|
|
|
|
connect_with_cert (serv_hostname, path_to_cert, url, args,
|
|
|
|
wait_thread, clVarsCore, crypto_Error, Connect_Error)
|
|
|
|
wait_thread, clVarsCore, crypto_Error, Connect_Error)
|
|
|
|
|
|
|
|
if not wait_thread.isAlive():
|
|
|
|
|
|
|
|
wait_thread = StoppableThread()
|
|
|
|
|
|
|
|
wait_thread.start()
|
|
|
|
get_name_flag = True
|
|
|
|
get_name_flag = True
|
|
|
|
if Connect_Error:
|
|
|
|
if Connect_Error:
|
|
|
|
if crypto_Error and passwd_flag:
|
|
|
|
if crypto_Error and passwd_flag:
|
|
|
@ -395,7 +392,6 @@ def main():
|
|
|
|
print _("Exception: %s") %e
|
|
|
|
print _("Exception: %s") %e
|
|
|
|
tb.print_exc()
|
|
|
|
tb.print_exc()
|
|
|
|
wait_thread.stop()
|
|
|
|
wait_thread.stop()
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
client = Client_suds(url, \
|
|
|
|
client = Client_suds(url, \
|
|
|
|
transport = HTTPSClientCertTransport(None,None, path_to_cert))
|
|
|
|
transport = HTTPSClientCertTransport(None,None, path_to_cert))
|
|
|
@ -408,7 +404,7 @@ def main():
|
|
|
|
wait_thread.stop()
|
|
|
|
wait_thread.stop()
|
|
|
|
print '\b' + _('Failed to connect')+':', e
|
|
|
|
print '\b' + _('Failed to connect')+':', e
|
|
|
|
return 1
|
|
|
|
return 1
|
|
|
|
|
|
|
|
print server_host_name
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
import glob
|
|
|
|
import glob
|
|
|
|
all_cert_list = glob.glob(os.path.join(path_to_cert, '*.crt'))
|
|
|
|
all_cert_list = glob.glob(os.path.join(path_to_cert, '*.crt'))
|
|
|
@ -421,11 +417,15 @@ def main():
|
|
|
|
fit_cert_list.sort(key = len)
|
|
|
|
fit_cert_list.sort(key = len)
|
|
|
|
Connect_Error = 1
|
|
|
|
Connect_Error = 1
|
|
|
|
crypto_Error = 0
|
|
|
|
crypto_Error = 0
|
|
|
|
|
|
|
|
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 = \
|
|
|
|
connect_with_cert (cert_name, path_to_cert, url, args,
|
|
|
|
connect_with_cert (cert_name, path_to_cert, url, args,
|
|
|
|
wait_thread, clVarsCore, crypto_Error, Connect_Error)
|
|
|
|
wait_thread, clVarsCore, crypto_Error, Connect_Error)
|
|
|
|
|
|
|
|
if not wait_thread.isAlive():
|
|
|
|
|
|
|
|
wait_thread = StoppableThread()
|
|
|
|
|
|
|
|
wait_thread.start()
|
|
|
|
|
|
|
|
|
|
|
|
if Connect_Error == 0:
|
|
|
|
if Connect_Error == 0:
|
|
|
|
break
|
|
|
|
break
|
|
|
|