Django AWS S3 Invalid certificate using bucket name "."

I have the problem described in this.

I cannot collectstatic upload from django locally to our static.somesite.com , because S3 adds s3.amazon.com to the URL and then revokes its own *.s3.amazon.com certificate. I set the dns pointer for static.somesite.com, which points to the s3 service ip.

I have a set of AWS_S3_SECURE_URLS = False .

I don’t know how to solve this. This is a complete error message. I fully understand why this is happening, should there be a workaround? On our production server, this works fine. Just can not find the settings.

 boto.https_connection.InvalidCertificateException: Host static.somesite.com.s3.amazonaws.com returned an invalid certificate (remote hostname "static.somesite.com.s3.amazonaws.com" does not match certificate) { 'notAfter': 'Apr 9 23:59:59 2015 GMT', 'subjectAltName': ( ('DNS', '*.s3.amazonaws.com'), ('DNS', 's3.amazonaws.com')), 'subject': ( (('countryName', u'US'),), (('stateOrProvinceName', u'Washington'),), (('localityName', u'Seattle'),), (('organizationName', u'Amazon.com Inc.'),), (('commonName', u'*.s3.amazonaws.com'),) ) } 
+2
source share
1 answer

I dug up the code for the transport application that I used. It seemed like he was collecting configuration settings somewhere other than my django project settings, and overriding them.

A few years ago I tested the Google Cloud Storage for the Google Engine Testing Project, which meant that I installed the Gsutils package worldwide. Guess what? Gsutils also uses Boto! Therefore, as soon as I found out that I could install the boto configuration file, I started looking for it. Sitting on OSX, Finder does not have a ~ / .boto file or when listing files in my home directory with ls -al . Alas, when I tried to create it using nano ~/.boto voilΓ‘! There have already been many tweaks since I used Gsutils.

After that, I turned off #https_validate_certificates = True and everything works like a charm.

+5
source

Source: https://habr.com/ru/post/907519/


All Articles