Fix: SSL validation failed for https://ec2.us-west-2.amazonaws.com

This usually pops up on older AWS CLI clients, like the one in FreeBSD for example.

When you get this error using AWS CLI

# aws ec2 describe-instances

SSL validation failed for https://ec2.us-west-2.amazonaws.com/ [X509] PEM lib (_ssl.c:4298)

Quickly fix it with:

The below assumes you have 'curl' installed

curl https://www.amazontrust.com/repository/{SFSRootCAG2,AmazonRootCA4,AmazonRootCA3,AmazonRootCA2,AmazonRootCA1}.pem >> ~/.aws/ca_bundle.pem
aws configure set ca_bundle '~/.aws/ca_bundle.pem'

This is due to a missing CA. You could pass the "--no-verify-ssl" flag, but people on the Internet frown upon it. However, you are an adult, make your own choice. Use that or add the missing CA to your local machine.