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.add_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.add_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,440 points
123 views

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,090 points

Related Questions In AWS

+1 vote
1 answer
0 votes
1 answer
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,260 points
70 views
+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
• 56,160 points
44 views
+1 vote
1 answer

How to install Boto?

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

answered Nov 20, 2018 in AWS by Nabarupa
130 views
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,090 points
920 views
+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,090 points
140 views