SSL from Vercel not working for Microsoft Business Standard emails?

I asked the people from Next.js , but maybe Vercel would have a more direct answer?
Here is the link from my post in the Next.js forum:

Apparently, after I change from Business Basics to Business Standard from Microsoft, my emails stopped working using Nodemailer and Next.js

The piece of code is this:

import nodemailer from “nodemailer”;

export async function POST(req) {
const transporter = nodemailer.createTransport({
service: “Outlook365”,
auth: {
user: process.env.EMAIL,
pass: process.env.EPASSWORD,
},

tls: {
  rejectUnauthorized: true, 
 // rejectUnauthorized: false, // Allow self-signed certificates (development only)
  // ca: fs.readFileSync('path/to/your/self-signed-cert.pem'),  
  // since I don't have a file I copy and post it the SSL code given by Vercel.
  ca: process.env.SSLCERTIFICATE,
},

});

^^^ Up to a few weeks ago this code was working just fine without “tls” addtion

Today, if I do “rejectUnauthorized: false” ← this would work, but now I am taking away security, and that is something I didn’t need to do before.

The error I am now getting is this:

Error: self-signed certificate in certificate chain
at TLSSocket.onConnectSecure (node:_tls_wrap:1679:34)
at TLSSocket.emit (node:events:524:28)
at TLSSocket._finishInit (node:_tls_wrap:1078:8)
at ssl.onhandshakedone (node:_tls_wrap:864:12)
at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
code: ‘ESOCKET’,
command: ‘CONN’

^^^ Questions:

Isn’t the SSL from Vercel not good enough for Microsoft Business Standard package?

Why was it working just a few weeks ago with Microsoft Business Basics? Why did it stop working today with Microsoft Business Standard?

No, I don’t think Nodemailer would it have a problem with it either, since I has been working for years also.

** what is the feedback from Microsoft? **

Basically next to nothing. The most they told me was that they didn’t know, that maybe I should ask Vercel first, and/or go buy a new SSL certificate to make it work… but their feedback is all just “maybe” do this or that.

Now, according to Chat GPT Microsoft should take the SSL that is automatically generated by Vercel, and I shouldn’t even need to include anything from the “tsl” section in the code, which GTP would be correct as it was the way I was using it until a few weeks ago before it broke when I changed to Business Standard from Microsfot.

So, what would be the feedback from Vercel on this?

I don’t think changing plan will have to do anything with SSL. Are you on corporate network or have antivirus which might be preventing our Letsencrypt certificate? I am not sure how the existing config used to work. but I have seen people to get affected due to network level block by IT team.

Not a corporate Network.

I am just a one guy from a single computer. I do have Norton anti-virus in my computer, but how would Norton stops the SSL in my computer? … and more important, why would it be working on the live website hosted by Vercel where Norton doesn’t have access?

Also, this is happening with 2 different emails:

1 - main email under Microsfot 365 Business Standard, Microsoft Power Automate Free
^^ from this email I can disable security in the code and it works for development.

2 - Exchange Online (Plan 1) email account
^^ this email doesn’t work at all, not even when disabling security. It gives me another auth error.
I have checked email and password, and this part is ok.

These emails are use on contact forms from live websites hosted at Vercel, and suddenly they don’t send me a contact form any more.

Also, one of the emails is used for automatic emails which ran a few emails a few weeks ago, and now they don’t work.

I don’t know what have changed, but Microsoft can’t give me an answer and they pretty much told me to try to buy a new SSL to see if it works.

Ok… hold it a second…

I am partially wrong.

Apparently the main email is working on the live site.

I have to do more testing with my second email that doesn’t work at all during productions.

Also… my main email wasn’t giving me an error during development before, but now it does, but I can solve by disabling security in development.

GUESS WHAT?

BOTH emails work just fine in production without any “tls” additions. Which means Vercel SSL is working just fine as the end result.

During production for some reason now I need to disable security, or else it gives me an error. ← this wasn’t the case before, but I guess things change.

I still need to figure out why my second email still not working during production even with the security disabled, but that might be something more for Microsoft.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.