Seagate driver: Add Basic auth header when logging in via HTTPS
New array firmware will use a new authentication method that does not
rely on MD5. To support this change while maintaining full backwards
compatibility, we'll also send a Basic auth header iff the connection
is encrypted.
@@ -120,6 +120,10 @@ class STXClient(object):
url = self._base_url + "/login/" + digest
try:
+ if self._protocol == 'https':
+ xml = requests.get(url, verify=self.ssl_verify, timeout=30,
+ auth=(self._login, self._password))
+ else:
xml = requests.get(url, verify=self.ssl_verify, timeout=30)
except requests.exceptions.RequestException:
msg = _("Failed to obtain MC session key")
