We are using a proxy + profile when using the aws s3
commands to browse our buckets in CLI.
export HTTPS_PROXY=https://ourproxyhost.com:3128
aws s3 ls s3://our_bucket/.../ --profile dev
And we can work with our buckets and objects fine.
Because I need to write Python code for this, I translated this using boto3:
# python 2.7.12
import boto3 # v1.5.18
from botocore.config import Config # v1.8.32
s3 = boto3.Session(profile_name='dev').resource('s3', config=Config(proxies={'https': 'ourproxyhost.com:3128'})).meta.client
obj = s3.get_object(Bucket='our_bucket', Key='dir1/dir2/.../file')
What I get is this:
botocore.vendored.requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
Why is this working in CLI, but not in Python?