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: