Error SSL CERTIFICATION VERIFY FAILED while trying to connect to S3

0 votes

I am trying to connect to S3 using boto, but i am getting an error. [SSL : CERTIFICATE_VERIFY_FAILED].

Can anyone help me with this? I have attached the code below.

import boto

if not boto.config.has_section('Credentials'):
boto.config.set('Credentials', 'aws_access_key_id', AWS_KEY)
boto.config.set('Credentials', 'aws_secret_access_key', AWS_SECRET_KEY)
if not boto.config.has_section('Boto'):
    boto.config.set('Boto', 'https_validate_certificates', 'False')
    boto.config.add_section('aws info')
    boto.config.set('aws info','aws_validate_certs','False')
s3 = boto.connect_s3(validate_certs=False)
bucket = s3.get_bucket(Bucket_NAME)

Aug 6, 2018 in AWS by datageek
• 2,530 points

1 answer to this question.

0 votes

Probably your bucket name contains a dot, that's why ssl certificate verification fails. This is quite a frequent problem.

Don't use an insecure connection (is_secure=False), instead use OrdinaryCallingFormat:

import boto conn = boto.s3.connect_to_region('eu-west-1', calling_format=boto.s3.connection.OrdinaryCallingFormat()) bucket = conn.get_bucket(your_bucket)

You might probably need to update your AWS Region as well.

answered Aug 6, 2018 by Archana
• 4,150 points

Related Questions In AWS

+1 vote
1 answer
0 votes
1 answer
+2 votes
1 answer

<Error> <Code>AccessDenied</Code> not able to connect s3 bucket.

Hi@akhtar, You have to give permissions to your ...READ MORE

answered Jun 3, 2020 in AWS by MD
• 95,300 points
0 votes
1 answer

How can I return XML from boto calls?

I don't think there's an officially supported ...READ MORE

answered Jul 20, 2018 in AWS by Cloud gunner
• 4,650 points
+1 vote
1 answer

How to authenticate session in application running on Beanstalk with boto3

The recommended way of managing credentials used ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 58,140 points
+1 vote
1 answer

How to install Boto?

You can install Boto using pip. There ...READ MORE

answered Nov 21, 2018 in AWS by Nabarupa
0 votes
1 answer

AWS S3 CLI : error while trying to copy files locally using terminal

For the first error you should add ...READ MORE

answered Aug 3, 2018 in AWS by Archana
• 4,150 points
+1 vote
1 answer

Invalid hostname error when connecting to S3 using secret key

Hey, it works perfectly fine you just ...READ MORE

answered Oct 11, 2018 in AWS by Archana
• 4,150 points