Skip to main content

Create self signed SSL certificate

Create a self-signed SSL certificate for React JS, before starting to explore, I want to add a little bit about this

A self-signed certificate is a digital certificate that is created and signed by the same entity it identifies. Unlike certificates issued by trusted Certificate Authorities (CAs), self-signed certificates aren't verified by external parties. They're commonly used for local development, testing, or internal systems where the identity verification provided by a CA is not necessary. Although self-signed certificates can secure communication, they lack the third-party validation provided by CA-signed certificates, and users may encounter browser warnings when accessing websites using self-signed certificates.

it will done in a few steps

there are lots of ways to create a Self-signed certificate but I am using here mkcert

you can visit this URL 

https://chocolatey.org/install#individual

and download the steps to install Chocolatey, if you don't want to visit it just need to follow the steps for Windows

1. Open the PowerShell in administrator mode and execute the below script

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))


once you execute it, it will download the Chocolatey, and also create the environment in your window machine

to verify, you can simply check the environmental variable from your compute property

you can also verify from the install location by opening

C:\ProgramData\chocolatey

once you verify, need to execute some other commands, in the Powershell

2. choco install mkcert

you can also ensure the mkcert is installed or not by checking the same location.

once you verify just run the 

3. mkcert -version

to check which version was installed.

now the next step is to execute

4. mkcert -install

this command installed the mkcert environment on your machine

now we are in the final step, you have to open your Visual Studio Code, solution inside the root folder of your react app, and execute the below commands

5. mkcert -key-file localhost-key.pem -cert-file localhost.pem localhost

these commands create key and certificate files in your local machine, here I am using localhost for my local development environment, you can replace it if you are using any specific domain for development




now we are very close.

the last step is to open your package.json file and add the path on the start command example

"start": "set HTTPS=true&&set SSL_CRT_FILE=
./localhost.pem&&set SSL_KEY_FILE=./localhost-key.pem
&&react-scripts start",




These commands told the system to start in https mode.

now you only need to run this

6. npm start

Thanks for referring to the article, please tell me if it is helpful to you.


Comments

Popular posts from this blog

Power Apps modern driven app Interview Question and answer

Question 1: What is a Power Apps modern driven app? Answer: A Power Apps modern driven app is a low-code/no-code application development platform provided by Microsoft. It allows users to create custom applications that can run on various devices and platforms without the need for extensive coding. These apps can be built using a visual interface and can integrate with different data sources. Question 2: What are the key components of a Power Apps modern driven app? Answer: The key components of a Power Apps modern driven app are: Screens : Screens serve as the user interface for the app and can include multiple layouts, controls, and data visualizations. Data sources : These are the various repositories where the app can retrieve and store data, such as SharePoint lists, SQL databases, Excel files, etc. Connectors : Connectors enable integration with external services and systems, allowing data to be fetched or updated. Formulas : Power Apps uses a formula language called Power Apps ...

Interview Questions of SPFx SharePoint

What is SPFx? The SharePoint Framework (SPFx) is a web part model that provides full support for client-side SharePoint development, it is easy to integrate with SharePoint data, and extend Microsoft Teams. With the SharePoint Framework, you can use modern web technologies and tools in your preferred development environment to build productive experiences and apps that are responsive and mobile-ready. Scenario Based asking Scenario 1: Scenario: Your team is developing a SharePoint Framework (SPFx) web part that needs to retrieve data from an external API and display it on a SharePoint site. The API requires authentication using OAuth 2.0. The web part should also allow users to refresh the data manually. Question 1: How would you approach implementing this functionality in an SPFx web...

SPFX Interview question for 2023

SPFx Interview Questions for 2023 Question 1: What is SharePoint Framework (SPFx)? Answer: SharePoint Framework (SPFx) is a development model introduced by Microsoft for creating client-side web parts and extensions for SharePoint Online and SharePoint 2019. It is based on modern web technologies like JavaScript, TypeScript, and React, providing a rich and responsive user experience. Question 2: What are the key advantages of using SPFx for SharePoint development? Answer: SPFx offers several advantages, such as: Responsive and mobile-ready web parts and extensions. Seamless integration with SharePoint data and services. Support for modern web development practices and tools. Easy deployment and hosting options. Enhanced security and isolation through the SharePoint app model. Question 3: Can you explain the structure of an SPFx solution? Answer: An SPFx solution consists of the following key components: Web Parts: These are the building blocks of SPFx solutions, representing the vi...