How To Resolve “Certificate_Verify_Failed” error when trying an AWS CLI command?

Problem Scenario  You try to use an AWS CLI command, but you get an error.  The error says "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:...)"

Possible solutions

#1  Redo the AWS configuration.  Issue this command: aws configure
Leave the AWS Access Key ID and the AWS Secret Access Key the way they are.  Look at the "Default region name."  Verify there is no letter at the end.  For example, make sure it is us-west-1, us-west-2, or us-east-1.  Letters at the end of the zone name may appear in the "Availability Zone" in the AWS Console or the results of a describe-instances command on a working installation of AWS CLI.  However, you must truncate the letter for the purposes of configuring the AWS CLI if you are getting errors such as the one listed above.  (If you want to reinstall the AWS CLI, see this posting.)

#2  If the problem is not that there is a letter at the end of the availability zone, try to uninstall certifi and reinstall it with a specific version.  Assume the root user, then try these commands:
pip uninstall certifi
pip install certifi==2015.04.28

If pip is not installed, see this posting. As a reminder for AWS instances, "ec2-user" is the default user for RHEL and SUSE Linux.  For AWS instances, "ubuntu" is the default user for Ubuntu Linux.

If you need assistance installing pip, see the following links depending on your version of Linux:

Join the Conversation


  1. “Verify there is no letter at the end” <- I fought for hours and this is what my issue was the whole time. Thank for posting this!

  2. I like your post very much. It is very much useful for my research. I hope you to share more info about this. Keep posting!!

Leave a comment

Your email address will not be published. Required fields are marked *