Skip to content

Fixes certificate mismatch error on ec2.us-east-1.amazonaws.com#2

Open
danpopp wants to merge 2 commits intoepheph:masterfrom
danpopp:master
Open

Fixes certificate mismatch error on ec2.us-east-1.amazonaws.com#2
danpopp wants to merge 2 commits intoepheph:masterfrom
danpopp:master

Conversation

@danpopp
Copy link

@danpopp danpopp commented Feb 14, 2014

See commit 69c9944 for complete detailed information about this error.

This fixes the invalid certificate issue caused by incorrect URL subdomain. Since Amazon's SSL/TLS certificate is for https://ec2.<REGION-URL>.amazonaws.com  and not https://<REGION-URL>.ec2.amazonaws.org (error output below).

Traceback (most recent call last):
  File "../../fec2-din.py", line 95, in <module>
    reservations = ec2_conn.get_all_instances()
  File "/Library/Python/2.7/site-packages/boto/ec2/connection.py", line 575, in get_all_instances
    max_results=max_results)
  File "/Library/Python/2.7/site-packages/boto/ec2/connection.py", line 656, in get_all_reservations
    [('item', Reservation)], verb='POST')
  File "/Library/Python/2.7/site-packages/boto/connection.py", line 1127, in get_list
    response = self.make_request(action, params, path, verb)
  File "/Library/Python/2.7/site-packages/boto/connection.py", line 1073, in make_request
    return self._mexe(http_request)
  File "/Library/Python/2.7/site-packages/boto/connection.py", line 910, in _mexe
    request.body, request.headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 955, in request
    self._send_request(method, url, body, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 989, in _send_request
    self.endheaders(body)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 951, in endheaders
    self._send_output(message_body)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 811, in _send_output
    self.send(msg)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 773, in send
    self.connect()
  File "/Library/Python/2.7/site-packages/boto/https_connection.py", line 124, in connect
    'certificate' % hostname)
boto.https_connection.InvalidCertificateException: Host us-east-1.ec2.amazonaws.com returned an invalid certificate (remote hostname "us-east-1.ec2.amazonaws.com" does not match certificate): {'notAfter': 'Sep 17 23:59:59 2014 GMT', 'subject': ((('countryName', u'US'),), (('stateOrProvinceName', u'Washington'),), (('localityName', u'Seattle'),), (('organizationN
ame', u'Amazon.com Inc.'),), (('commonName', u'ec2.us-east-1.amazonaws.com'),))}
For detailed description see: commit 69c9944
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant