diff --git a/libtisbackup/backup_xva.py b/libtisbackup/backup_xva.py index 4e0830b..f737726 100755 --- a/libtisbackup/backup_xva.py +++ b/libtisbackup/backup_xva.py @@ -35,7 +35,9 @@ import tarfile import hashlib from stat import * import ssl -ssl._create_default_https_context = ssl._create_unverified_context + +if hasattr(ssl, '_create_unverified_context'): + ssl._create_default_https_context = ssl._create_unverified_context class backup_xva(backup_generic): diff --git a/libtisbackup/copy_vm_xcp.py b/libtisbackup/copy_vm_xcp.py index 44e6c09..62806bb 100755 --- a/libtisbackup/copy_vm_xcp.py +++ b/libtisbackup/copy_vm_xcp.py @@ -34,7 +34,8 @@ import base64 import socket from stat import * import ssl -ssl._create_default_https_context = ssl._create_unverified_context +if hasattr(ssl, '_create_unverified_context'): + ssl._create_default_https_context = ssl._create_unverified_context class copy_vm_xcp(backup_generic):