mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-08 15:23:00 -06:00
ipa-migrate - properly handle invalid certificates
A ValueError is raised when an invalid certificate is used, so the tool should handle this properly and not produce a stack trace. Fixes: https://pagure.io/freeipa/issue/9642 Signed-off-by: Mark Reynolds <mreynolds@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
2ddca5d5d5
commit
0e4fbc3b0d
@ -761,6 +761,12 @@ class IPAMigrate():
|
|||||||
try:
|
try:
|
||||||
ds_conn = LDAPClient(ldapuri, cacert=self.args.cacertfile,
|
ds_conn = LDAPClient(ldapuri, cacert=self.args.cacertfile,
|
||||||
start_tls=True)
|
start_tls=True)
|
||||||
|
except ValueError:
|
||||||
|
# Most likely invalid certificate
|
||||||
|
self.handle_error(
|
||||||
|
"Failed to connect to remote server: "
|
||||||
|
"CA certificate is invalid"
|
||||||
|
)
|
||||||
except (
|
except (
|
||||||
ldap.LDAPError,
|
ldap.LDAPError,
|
||||||
errors.NetworkError,
|
errors.NetworkError,
|
||||||
|
Loading…
Reference in New Issue
Block a user