GithubHelp home page GithubHelp logo

bc-peng / set-up-ssl-in-nodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sagardere/set-up-ssl-in-nodejs

1.0 0.0 3.0 2.07 MB

Set-up SSL in NodeJS and Express using OpenSSL

License: MIT License

JavaScript 100.00%

set-up-ssl-in-nodejs's Introduction

Before starting with the project, please do the following steps:

1. Create a pair of self-signed certificate and key

Enter certsFiles folder and run:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./selfsigned.key -out selfsigned.crt

After you run the above command, answer the following questions:

Country Name (2 letter code) [AU]: US
Email Address []: Your email
etc

If all went well, you should see two new files in the certsFiles directory, i.e. selfsigned.key and selfsigned.crt.

2. Install dependencies

npm install

3. Start your local server

npm start

Visit https://localhost:5000 and you should see Hello World. You might edit index.js to change the port number.

You may see some SSL warning. That’s because the certificate isn’t issued by any verified organization. What you want to do is, add the crt as an exception to your browser.

4. Update loader.js

public is the pre-defined root directory from which to serve static assets. The URL of this repo's loader.js is https://localhost:5000/v1/loader.js.

set-up-ssl-in-nodejs's People

Contributors

sagardere avatar bc-peng avatar

Stargazers

Vitalii Koshovyi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.