I use the following code with this lib
provider, err := oidc.NewProvider(ctx, providerURI)
if err != nil {
log.Println(err)
}
While running it locally with same providerURI it works, I was able to get the provider successfully!
I deployed it to K8S with the exact same provider url (as env variable ) and debug it using port-forwarding ,
However, in k8S I got error and dont get the provider.
The error is:
2020/08/14 16:42:22 Get "https://ace.svar.com/.well-known/openid-configuration": x509: certificate signed by unknown authority
I've added the certificate to the image and verify it, I exec into k8s container after deploy and I see the server.crt file under /usr/local/share/ca-certificates/ path.
And still got the same error, any idea if I miss here something else ... Not sure if it really related to the OIDC lib or something more general..
FROM golang:1.14.7 AS builder
RUN go get github.com/go-delve/delve/cmd/dlv
ADD server.crt /usr/local/share/ca-certificates/server.crt
RUN chmod 644 /usr/local/share/ca-certificates/server.crt && update-ca-certificates
RUN mkdir /app
ADD . /app
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux go build -gcflags="all=-N -l" -o main ./...
FROM debian:buster AS production
COPY --from=builder /app .
COPY --from=builder /go/bin/dlv /
COPY --from=builder /usr/local/share/ca-certificates/ /usr/local/share/ca-certificates/
EXPOSE 8000 40000
ENV SSL_CERT_DIR=/usr/local/share/ca-certificates/
ENV PORT=8000
CMD ["/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "./main"]
I got replay from the author of the GO-OIDC repository to try to use
https://godoc.org/github.com/coreos/go-oidc#ClientContext
Not sure how, any idea?