basecamp / kamal-proxy

Lightweight proxy server for Kamal
https://kamal-deploy.org/
MIT License
751 stars 31 forks source link

x509: certificate signed by unknown authority #64

Closed edimoldovan closed 3 weeks ago

edimoldovan commented 3 weeks ago

Hi folks,

I am doing a request to google fonts api and getting this

2024/11/02 18:50:22 Get "https://www.googleapis.com/webfonts/v1/webfonts?capability=WOFF2&key=[key]&sort=alpha": tls: failed to verify certificate: x509: certificate signed by unknown authority

I am not yet able to understand what issue exactly this is, any chance anyone seen anything similar while running behind kamal-proxy?

Happy to debug, let me know

Thanks, ed

edimoldovan commented 3 weeks ago

Found the issue in the meantime. Sharing the solution here in case others also run into it.

The scratch docker image has no certificates, so I added them like below:

# The run stage
FROM scratch
# this one is the fix
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 
WORKDIR /app
COPY --from=builder /app/main .
EXPOSE 80
CMD ["./main"]