Add local certificates in Alpine container?

Hello !

1. The problem I’m having:

I have some websites/services running locally in containers.
I use Caddy as a reverse proxy.

I need to access the url of a container (say https://domain1.local) from another container.
There comes a SSL problem :

curl: (60) SSL certificate problem: unable to get local issuer certificate

All the certificates are stored in /var/lib/caddy/.local/share/caddy/certificates/local/
I tried to add all .crt files to my container, but after many tries, can’t make HTTPS to work.

Do you have any idea how I can add my local certificates to the container ?
My container runs Alpine LInux 3.18.

Thank you :sunny:

2. Error messages and/or full log output:

curl: (60) SSL certificate problem: unable to get local issuer certificate

3. Caddy version:

v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=

4. How I installed and ran Caddy:

Static binary, running as a service.

a. System environment:

Fedora 36 x86_64

b. Command:

c. Service/unit/compose file:

d. My complete Caddy config:

# Only reverse proxies like this

domain1.local {
    reverse_proxy 127.0.0.1:8001
}

5. Links to relevant resources:

See ssl - How to add trusted root CA to Docker alpine - Stack Overflow, this isn’t really a Caddy question, and rather a Alpine/Docker question.

@francislavoie Thank you for the answer.
I already tried that and other things before asking here, without luck.
I think i needed a clear explanation of what exactly I should add to the ca-certificate.crt.

But nevermind, I used caddy trust --address in the container and all is working now.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.