when sending a mail (nodemailer) with secure set to true:
const transporter = nodemailer.createTransport({
host: process.env.SMTP_SERVER_HOST,
port: process.env.SMTP_SERVER_PORT,
secure: true,
auth: {
user: process.env.SMTP_USERNAME,
pass: process.env.SMTP_PASSWORD,
},
});
my appwrite function exits with Error: 139628785929072:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
sending the mail with secure turned off works without issues.
do you have any fix for sending the mail with secure turned on?
This is cloud or self-hosted?
the latter
Are you using TLS ports?
There should be ports from your provider to use without TLS and others to use with TLS. This looks like you're using a port that doesn't supports TLS by your provider
im running appwrite behind a reverse proxy and the traffic goes over https to the http port of appwrite
Oh, I see. But you're self-hosting the SMTP server?
nope
No idea then. From what I'm seeing on Google, looks like others users solved it by changing ports but also others solved it by changing TLS version
found my issue:
this is from the node mailer docs: secure – if true the connection will use TLS when connecting to server. If false (the default) then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false
my port for smpt is indeed 587
and uses STARTTLS
I see. Hope that solves the issue
I supposed it was related to some config related to ports
i also thought so, thanks for the help
Tell me if that's the final solution and it works
seems like it
[SOLVED] SSL error when sending email with nodemailer
Recommended threads
- I can't UNPAUSE my project with the free...
I received an email notifying me that my project had been paused due to inactivity, and the email included a link to "Restore project." However, that button red...
- Error trying to deploy functions from CL...
✗ Error • on-auth-create (6a00b2ab000c9ce2949b) • Server Error ✗ Error: No functions were pushed. Prject ID: 69ffe0270033a4ac420a
- Intermittent Deploy and Execution Errors...
Project: project-fra-658e2f5f4ba30df91177 Function ID: 69bde006001c56757f49 **Several execution errors with:** Timed out waiting for runtime.\nError Code: 400...