My cluster is not connecting when I use express session

I’m building a simple blog website using mongodb.

I can’t connect to my mongodb when I use express-session dependency. The error code is “error: MongoNetworkError: 4048EDEA01000000:error:0A000438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error:…/deps/openssl/openssl/ssl/record/rec_layer_s3.c:1586:SSL alert number 80”.

If I don’t use express-session I can connect to my cluster without any problem. I connect it using “app.use(
session({
secret: process.env.SESSION_SECRET,
resave: false,
saveUninitialized: false,
store: MongoStore.create({
mongoUrl: process.env.MONGODB_URI
}),
})
)” this code. Upon my research, many people who had similar problems said that the problem is with IP address being not whitelisted, but that’s not the case here. Please help what I’m doing wrong.

Possibly related (I wrote up an article at Node.js Driver failing to connect due to "unsafe legacy renegotiation disabled" | ALEX BEVILACQUA with more detail), but it’s possible you may just need to upgrade the version of the Node.js runtime you’re using.

If you’re not running v22 that should be the latest LTS based on Node’s release schedule