---
title: "\"SSLHandshakeException\" when establishing a secure connection in a MERN application"  
description: "\"SSLHandshakeException\" when establishing a secure connection in a MERN application"  
author: "Utpal Vishwas"  
published: 2023-08-04  
updated: 2023-08-04  
canonical: https://www.mindstick.com/forum/159459/sslhandshakeexception-when-establishing-a-secure-connection-in-a-mern-application  
category: "mern"  
tags: ["exception handling", "javascript"]  
reading_time: 2 minutes  

---

# "SSLHandshakeException" when establishing a secure connection in a MERN application

"SSLHandshakeException" when establishing a [secure connection](https://www.mindstick.com/forum/2279/the-smtp-server-requires-a-secure-connection-when-i-try-to-send-an-email) in a [MERN](https://www.mindstick.com/forum/159452/fix-file-upload-failed-in-mern) [application](https://www.mindstick.com/articles/12824/calculator-application-in-android)

## Replies

### Reply by Aryan Kumar

An SSKHandshakeException is a type of error that can occur when you are trying to establish a [secure](https://www.mindstick.com/articles/44535/smart-ways-to-secure-self-storage-facilities) [connection](https://www.mindstick.com/articles/13012/what-makes-ethernet-connection-better-than-wifi) (HTTPS) in a MERN application. This error can be caused by a variety of factors, such as:

- **The server is not configured to use HTTPS:** Make sure that your server is configured to use HTTPS. You can do this by installing the `https` module and then setting the `protocol` property of your `app` object to `https`.
- **The client is not configured to use HTTPS:** Make sure that your client is configured to use HTTPS. You can do this by setting the `protocol` property of your `request` object to `https`.
- **There is a problem with the certificate:** Make sure that the certificate that is being used by the server is valid. You can use a tool like `openssl` to verify the certificate.
- **There is a problem with the handshake:** The handshake is the process of establishing a secure connection between the client and the server. If there is a problem with the handshake, the SSKHandshakeException error will be thrown.

Here are some tips for troubleshooting SSKHandshakeException errors:

- **Check the server configuration:** Make sure that the server is configured to use HTTPS. You can do this by checking the `protocol` property of your `app` object.
- **Check the client configuration:** Make sure that the client is configured to use HTTPS. You can do this by checking the `protocol` property of your `request` object.
- **Verify the certificate:** Use a tool like `openssl` to verify the certificate that is being used by the server.
- **Check the logs:** The logs may contain more information about the error.

If you are still having trouble troubleshooting SSKHandshakeException errors, you can ask for help on a forum or chat room like Stack Overflow or Node.js Discord.


---

Original Source: https://www.mindstick.com/forum/159459/sslhandshakeexception-when-establishing-a-secure-connection-in-a-mern-application

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
