self.base_url = 'https://' + self.host + '/' # This never changes
# Sanity check the numerical version.
- self.version = s.get('version', '14')
- if self.version not in ['9', '10', '11', '12', '13', '13.1', '14']:
+ self.version = s.get('version', '14.1')
+ if self.version not in ['9', '10', '11', '12', '13', '13.1',
+ '14', '14.1']:
msg = 'Invalid version "' + self.version + '" '
msg += 'in section "' + s.name + '"'
raise configparser.ParsingError(msg)
# SSL mumbo jumbo to make it ignore the certificate's hostname
# when verify_cert = False.
- if self.verify_cert:
- ssl_ctx = ssl.create_default_context()
- else:
- ssl_ctx = ssl._create_unverified_context()
+ ssl_ctx = ssl.create_default_context()
+ if not self.verify_cert:
+ ssl_ctx.check_hostname = False
+ ssl_ctx.verify_mode = ssl.CERT_NONE
https_handler = urllib.request.HTTPSHandler(context=ssl_ctx)
elif self.version in ['10', '11', '12', '13']:
# The procedure for v11, v12, or v13 is the same as for v10.
return self.get_backup_v10()
- elif self.version in ['13.1', '14']:
+ elif self.version in ['13.1', '14', '14.1']:
# But the minor update v13.1 moved the backup URL.
return self.get_backup_v13_1()
- else
+ else:
raise ValueError('unknown version %s' % self.version)