# Docker container can't make HTTPS calls: x509 certificate signed by unknown authority (image has no ca-certificates)

**Code:** `ca-certificates` · **Category:** SSL / TLS · **Seen on:** Docker, Go, SSL

Minimal or scratch images ship without a CA bundle, so every TLS verification fails inside the container.

## Meaning

Install `ca-certificates` in the image (`apt-get install -y ca-certificates` / `apk add ca-certificates`), or copy the bundle from a builder stage into `scratch`/distroless. For corporate CAs, add them and run `update-ca-certificates`.

## Common causes

- scratch/slim/alpine image without ca-certificates
- Bundle not copied into the final stage
- Corporate root missing
- Stale bundle in an old image
- Wrong cert path for the runtime

## Quick fix

1. `RUN apt-get update && apt-get install -y ca-certificates`
2. `COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/`
3. Rebuild images regularly

## Detailed fix by platform

### Dockerfile

1. 

```bash
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY app /app
```


## How to diagnose

1. **Image** — Minimal?
2. **Bundle** — Present?
3. **Corporate CA** — Added?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ssl/docker-image-missing-ca-certificates)
