Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

x509 certificate signed by unknown authority - go-pingdom

Tags:

http

docker

go

x509

I'm using the Go package pingdom-go to query Pingdom. The application is containerized as this:

FROM alpine:3.8

USER nobody

ADD build/_output/bin/app /usr/local/bin/app

However I get the following error:

Get https://api.pingdom.com/api/2.1/checks/0: x509: certificate signed by unknown authority

I've already tried what suggested here x509 certificate signed by unknown authority but without luck. Any ideas?

like image 974
Mazzy Avatar asked Oct 28 '25 10:10

Mazzy


2 Answers

So the alpine containers are very minimal, including not having certs. You can either install the certs like @TimCooper suggested:

apk add --no-cache ca-certificates

You can also checkout GoogleContainerTools/distroless. It is minimal but has a few things like certs that make development life a little easier.

like image 103
poy Avatar answered Oct 31 '25 01:10

poy


add the following cmd to your Dockerfile can fix it.

FROM alpine:3.8

RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
like image 34
Jed Huo Avatar answered Oct 31 '25 02:10

Jed Huo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!