Recently, I started getting an error while trying to send an email via SMTP. It did work perfectly before.
The error:
Failed to send email Error: unable to verify the first certificate
2025-05-04T11:12:36Z app[2871e65f094428] mia [info] at TLSSocket.onConnectSecure (node:_tls_wrap:1600:34)
2025-05-04T11:12:36Z app[2871e65f094428] mia [info] at TLSSocket.emit (node:events:517:28)
2025-05-04T11:12:36Z app[2871e65f094428] mia [info] at TLSSocket._finishInit (node:_tls_wrap:1017:8)
2025-05-04T11:12:36Z app[2871e65f094428] mia [info] at ssl.onhandshakedone (node:_tls_wrap:803:12) {
2025-05-04T11:12:36Z app[2871e65f094428] mia [info] code: 'ESOCKET',
2025-05-04T11:12:36Z app[2871e65f094428] mia [info] command: 'CONN'
2025-05-04T11:12:36Z app[2871e65f094428] mia [info]}
This works locally via a simple Python script, but fails when deployed (I use fly.io).
My SMTP config looks like this:
SMTP_HOST=s30.wpx.net
SMTP_USERNAME=email
SMTP_PASSWORD=password
SMTP_PORT=465
Any ideas what can be missing and how I can debug this issue?