[aws] Fix issue with aws behind proxy and make S3_USE_SIGV4 default when region is set
@@ -160,16 +160,14 @@ class Client(object):
# Attempt to create S3 connection based on configured credentials and host or region first, then fallback to IAM
try:
- if self._host is not None:
# Use V4 signature support by default
os.environ['S3_USE_SIGV4'] = 'True'
+ if self._host is not None:
kwargs.update({'host': self._host})
connection = boto.s3.connection.S3Connection(**kwargs)
elif self._region:
connection = boto.s3.connect_to_region(self._region,
- aws_access_key_id=self._access_key_id,
- aws_secret_access_key=self._secret_access_key,
- security_token=self._security_token)
+ **kwargs)
else:
kwargs.update({'host': 's3.amazonaws.com'})
connection = boto.s3.connection.S3Connection(**kwargs)
