# SSL validation failed for https://... certificate verify failed

AWS error fixes · Updated 17 November 2026

**Short answer:** The CLI could not verify the TLS certificate presented by the endpoint it connected to. On a work network this almost always means a TLS-inspecting proxy (Zscaler, Netskope, a corporate firewall) is re-signing traffic with a company root certificate that the CLI's bundled CA store doesn't trust. Point the CLI at a bundle containing that root with AWS_CA_BUNDLE or ca_bundle in ~/.aws/config instead of turning verification off.

## What the error looks like

```
SSL validation failed for https://sts.eu-west-2.amazonaws.com/
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
unable to get local issuer certificate (_ssl.c:1006)
```

The URL tells you which endpoint failed (STS, S3, or `oidc.<region>.amazonaws.com` during `aws sso login`). The text after the colon tells you why: *unable to get local issuer certificate* or *self-signed certificate in certificate chain* mean an untrusted root; *hostname doesn't match* means a name problem; *certificate is not yet valid* means your clock is wrong.

AWS CLI v2 ships with its own Python and CA bundle, so adding a certificate to the operating system's store often has no effect on it. That surprises people whose browser works fine on the same network.

## Causes and how to tell

| Cause | Clue |
|---|---|
| TLS inspection proxy | Fails on the office network or VPN, works on home Wi-Fi; issuer is your company, not Amazon |
| Custom `ca_bundle` or `AWS_CA_BUNDLE` pointing to an old or wrong file | Fails everywhere; `aws configure get ca_bundle` returns a path |
| S3 bucket name containing dots | Error says hostname doesn't match `*.s3.amazonaws.com` |
| System clock far off | Certificate "not yet valid" or "expired" |
| Very old CLI version with an outdated bundle | `aws --version` is years old |

Check who issued the certificate you're actually receiving:

```
openssl s_client -connect sts.eu-west-2.amazonaws.com:443 \
  -servername sts.eu-west-2.amazonaws.com </dev/null 2>/dev/null \
  | openssl x509 -noout -issuer -subject
```

An issuer that names your employer or security vendor confirms TLS inspection.

## Fix it for a TLS-inspecting proxy

1. Get the proxy's root certificate in PEM format from your IT team or export it from your browser's certificate viewer.

2. Build a bundle that contains both the public roots and the corporate root, so endpoints that bypass the proxy still verify:

   ```
   cat /etc/ssl/certs/ca-certificates.crt corp-root.pem > ~/.aws/ca-bundle.pem
   ```

   (On macOS, export the system roots from Keychain Access, or ask IT for a combined bundle.)

3. Tell the CLI and SDKs to use it, either per shell or permanently:

   ```
   export AWS_CA_BUNDLE=~/.aws/ca-bundle.pem
   aws configure set ca_bundle ~/.aws/ca-bundle.pem
   ```

4. Retry `aws sts get-caller-identity`, then `aws sso login` if that was the failing step.

## Other fixes

- **Dotted bucket names**: virtual-hosted style URLs like `my.bucket.s3.amazonaws.com` can't match the wildcard certificate. Use path-style addressing for that bucket (`addressing_style = path` under an `s3` section in the profile), or rename the bucket without dots.
- **Clock**: sync with NTP, then retry. A badly wrong clock also breaks request signing.
- **Outdated CLI**: upgrade to a current AWS CLI v2 release.

## What not to do

`--no-verify-ssl` makes the error go away by accepting any certificate, including one from an attacker on the network, and it prints a warning on every call. It's acceptable for a one-off test that confirms the diagnosis, never as a permanent setting or in scripts. Likewise, don't disable inspection on your own; the proxy is usually a compliance requirement, and adding its root to the CLI's trust store is the supported route.

## Questions

### How do I fix SSL validation failed in aws sso login?

The SSO login talks to the oidc and portal endpoints, which your proxy is intercepting. Set AWS_CA_BUNDLE or ca_bundle to a PEM bundle that includes your corporate root certificate, then run aws sso login again.

### Why does my browser work but the AWS CLI fails with certificate verify failed?

Your browser trusts the operating system's certificate store, where IT installed the proxy's root. AWS CLI v2 uses its own bundled CA store, so it needs AWS_CA_BUNDLE pointing at the corporate root.

### Is --no-verify-ssl safe to use?

No. It disables certificate checks entirely. Use it only to confirm the diagnosis, then configure a proper CA bundle.

## When this happens away from your desk

Certificate errors on a corporate network can lock you out of the CLI at the moment you need it. CloudConsole, a phone app for AWS, is built to show alarms, logs and resources on your phone over a different network path while you sort out the proxy.

[About the CloudConsole app](https://cloudconsole.dev/aws-console-app) · [Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## Sources

- [Configuration and credential file settings in the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
- [Environment variables to configure the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)

## Related

- [InvalidSignatureException: Signature expired](https://cloudconsole.dev/errors/signature-expired-clock-skew)
- [How to log in to AWS SSO from the CLI](https://cloudconsole.dev/how-to/aws-sso-login-cli)
- [aws configure](https://cloudconsole.dev/cli/configure)
- [PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint](https://cloudconsole.dev/errors/s3-permanentredirect)
- [Unable to parse config file: ~/.aws/config](https://cloudconsole.dev/errors/unable-to-parse-config-file)
- [Could not connect to the endpoint URL](https://cloudconsole.dev/errors/could-not-connect-to-endpoint-url)

---

Source: https://cloudconsole.dev/errors/ssl-validation-failed

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
