Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS SES Error: x509: certificate signed by unknown authority

I've been banging my head against the table with this one for a while now. I'm. I've successfully sent emails locally using an AWS access key and secret that has full access. Once I deploy to my staging environment I get an error using the same access key and secret.

RequestError: send request failed\ncaused by: Post https://email.us-east-1.amazonaws.com/: x509: certificate signed by unknown authority

Please help!

like image 756
Shane Da Silva Avatar asked Dec 23 '22 03:12

Shane Da Silva


2 Answers

If you are using alpine docker image for example:

FROM alpine:3.6 as alpine

RUN apk add -U --no-cache ca-certificates

FROM scratch
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

After adding root certificates ca-certificates, it will be working fine.

like image 109
KorbenDallas Avatar answered Jan 20 '23 09:01

KorbenDallas


My project is deployed on Ubuntu machine and I am using Golang, so here is my Dockerfile.

Please note that I have used COPY command twice. I successfully deployed my project and its working as expected.

FROM golang:1.16.5 AS builderStep

# Install Certificate
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates

FROM scratch AS app

# Copy Certificate
COPY --from=builderStep /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

COPY --from=builderStep /my/source/code/ .

like image 33
Muhammad Tariq Avatar answered Jan 20 '23 11:01

Muhammad Tariq