Search code examples
amazon-web-servicesssl-certificateamazon-elastic-beanstalkaws-cli

AWS CLI - [SSL : CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1056)


Am trying to use AWS-CLI to retrieve aws elasticbeanstalk details, but am getting the following error.

Error message:

C:\abdul>aws elasticbeanstalk describe-environments --environment-name myenvname

SSL validation failed for https://elasticbeanstalk.us-east-1.amazonaws.com/ [SSL
: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate
in certificate chain (_ssl.c:1056)

Note:

I can work without any issues when I try to retrieve my EC2 details,

C:\abdul>aws ec2 describe-instances --instance-ids 'i-xxxxxxxxxxxxxx'

Above command works without any issues, I get the above error only when I try "elasticbeanstalk" commands.

Note: I have all the necessary certificates required in place.

Thanks in advance.


Solution

  • I found my way to this post while Googling. In my case, the error message I received was: SSL validation failed for https://ec2.us-west-2.amazonaws.com/ [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)

    I found this blog which told me to add an Environment Variable called AWS_CA_BUNDLE whose value was a path pointing to the CA Cert file (which I had saved on my local machine after requesting it from our corporate network team). Once I added that environment variable, I was able to run my AWS CLI commands successfully!