AWS SES Error: Unable to Send Emails Due to Unknown Certificate Authority
When attempting to send emails through Amazon Simple Email Service (SES) using an AWS access key and secret, users may encounter an error message stating:
Post https://email.us-east-1.amazonaws.com/: x509: certificate signed by unknown authority
Root Cause
This error occurs when the deployed environment lacks access to valid root certificates for validating the certificate chain used by the SES endpoint.
Solution
To resolve this issue, ensure that the deployed environment has access to root certificates by incorporating them into your application image. Here's an example using the Alpine Linux docker image:
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 the root certificates, the email sending functionality through SES should operate as intended.
The above is the detailed content of Why Does My AWS SES Send Fail with \'x509: certificate signed by unknown authority\'?. For more information, please follow other related articles on the PHP Chinese website!