AWS ECR ssl certificate verify failed.
I'm trying to start an ECS and when I get to the step to retrive my docker info:
aws ecr get-login --region eu-west-1 I get the error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
I've also tried to do it with --no-verify-ssl but then I get :
C:\Users\whatever\AppData\Local\Programs\Python\Python35-32\lib\site-packages\botocore\vendored\requests\packages\urllib3\connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::982****37**5:user/whatever is not authorized to perform: ecr:GetAuthorizationToken on resource: *
I am behind a corporate proxy, I do have my proxy set up. How can I fix this or what are some workarounds to get the info ?
Not sure. We'll need more information to be able to help:
- What version of the CLI are you using (
aws --version) - Do you get the same cert error if you try something like curl/wget? What's the output of
curl https://ecr.us-west-2.amazonaws.com/ - Do other CLI commands work for you? For example
aws ec2 describe-regions
I tried this command locally for me and it's working, so that would suggest that the vendored cert bundle is working as expected. My best guess is it might be something with your proxy settings.
If you're still having issues, could you also share a sanitized --debug log of the command?
Aws version: aws-cli/1.10.64 Python/3.5.1 Windows/10 botocore/1.4.54
I'm running on windows so I don't really have curl or wget, could download them if you want to.
aws ec2 describe-regions also gives a SSL verify failed. Yet, this one with --no-verify-ssl gives back a xml.
Also, here is a debug file for aws ec2 describe-regions ( not sure how to sanitize it ): http://ctrlv.it/id/7829/721827780
Thanks @jamesls !
I believe curl is aliased on powershell, so even thought it's not the same as curl on linux it should still work.
What I'd like to see if whether or not the systems certs you have locally are the root cause or not. If trying the curl command in powershell also fails, then that would suggest the error has to do with your system certs or proxy setup. However if the powershell command succeeds then it would suggest something's going on in the CLI.
Could you try curl https://ecr.us-west-2.amazonaws.com/ on powershell?
@jamesls. Doesn't seem to work:
curl : Missing Authentication Token
At line:1 char:1
+ curl https://ecr.us-west-2.amazonaws.com/
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
I'm behind a corporate proxy which I do have set up. I did set up my env variables http_proxy and https_proxy.
It looks like curl is failing for reasons unrelated to ECR, most likely your proxy is doing something and there isn't really anything we can do to get visibility into the problem from our side.
While importing I was getting
Failed to import certificate There was a problem when importing your certificate.
But found out that I had to copy
Siteground values -> AWS values Certificate (CRT) -> Certificate body
Private Key (KEY) -> Certificate private key
Certificate Authority -> Certificate chain - optional Bundle (CABUNDLE)
I wasn't doing the third one.